I want to know how to work with connected clients on TTcpServer class?
I got a client connected on method “ServerAccept” whats next? How can i work with them?
I need to start from ServerAccept a new thread to work with socket client?
I want to know how to work with connected clients on TTcpServer class? I
Share
The
TTcpServer.OnAcceptevent is triggered when theTTcpServer.Accept()method is called and a client is accepted. ALL socket work with that client has to be done within the context of theTTcpServer.OnAcceptevent, using the methods of theTCustomIpClientobject that is provided by the event. As soon as the event handler exits,TTcpServercloses the connection. If theTTcpServer.BlockModeproperty is set tobmThreadBlocking, theOnAcceptevent handler runs in a thread managed byTTcpServerso you do not need to create your own thread. Otherwise, you need to call theTTcpServer.Accept()method in your own code, in which case you can call it in your own thread if desired.