This page is available in Simplified Chinese.
TCP Echo server
The repository’s AioEchoServer receives one line of text and sends it back to the client. In your IDE, run its main method with neta-core on the classpath.
NetManagerlistens on TCP port 5567.LineBasedFrameHandlersplits the input into lines, andStringHandlerconverts between bytes and strings.- The application subscribes to inbound messages and replies through
NetChannel.sendDatawithechofollowed by the text it received.
Connect locally with telnet 127.0.0.1 5567. Type hello and press Enter. The server returns echo hello. Press Enter in the server console to exit the example.
See Protocol pipelines for more details.