API - 语义服务器 — chat 1.0.5 documentation

# API - 语义服务器

Create and start NLU TCPServer with socketserver. 创建并启动语义理解服务器。

The socketserver module simplifies the task of writing network servers.

`MyTCPHandler`(request, client_address, server) | The request handler class for nlu server.
`start`([host, port]) | Start NLU server.

## 创建语义服务器

`chat.server.` `MyTCPHandler`(request, client_address, server)

  The request handler class for nlu server. 语义理解服务器。

  It is instantiated once per connection to the server, and must override the ‘handle’ method to implement communication to the client.

## 启动语义服务器

`chat.server.` `start`(host='localhost', port=7000)

  Start NLU server.

  Create the server, binding to host and port. Then activate the server. This will keep running until you interrupt the program with Ctrl-C.

  Args:
    host: Server IP address. 服务器IP地址设置。
      Defaults to “localhost”.
    port: server port. 服务器端口设置。
      Defaults to 7000.