Two projects are attached: EchoServer and EchoClient.
Open two instances of B4J, run EchoServer in Release mode and run EchoClient in debug or release mode. The client connects to the server which echos the client messages.
This example is not based on prefix mode. It is based on AsyncStreamsText which builds messages based on the end of line character(s). It is better to use prefix mode, however it is only possible if you implement both sides in B4X.