paddlespeech.s2t.utils.socket_server module
- class paddlespeech.s2t.utils.socket_server.AsrRequestHandler(request, client_address, server)[source]
Bases:
BaseRequestHandlerThe ASR request handler.
Methods
finish
handle
setup
- class paddlespeech.s2t.utils.socket_server.AsrTCPServer(server_address, RequestHandlerClass, speech_save_dir, audio_process_handler, bind_and_activate=True)[source]
Bases:
TCPServerThe ASR TCP Server.
- Attributes
- timeout
Methods
close_request(request)Called to clean up an individual request.
fileno()Return socket file number.
finish_request(request, client_address)Finish one request by instantiating RequestHandlerClass.
get_request()Get the request and client address from the socket.
handle_error(request, client_address)Handle an error gracefully.
handle_request()Handle one request, possibly blocking.
handle_timeout()Called if no new request arrives within self.timeout.
process_request(request, client_address)Call finish_request.
serve_forever([poll_interval])Handle one request at a time until shutdown.
server_activate()Called by constructor to activate the server.
server_bind()Called by constructor to bind the socket.
server_close()Called to clean-up the server.
service_actions()Called by the serve_forever() loop.
shutdown()Stops the serve_forever loop.
shutdown_request(request)Called to shutdown and close an individual request.
verify_request(request, client_address)Verify the request.