Author Topic: How to keep client connection open after handling TSocketServer OnConnect event  (Read 770 times)


  • Jr. Member
  • **
  • Posts: 94
    • Fano Framework, Free Pascal web application framework

Please correct me if I am wrong.

Source code of TServerSocket class

tells me that when we handle its OnConnect event, it is developer's responsibility to free socket stream instance when they are done, otherwise we will leak memory.
Freeing socket stream will cause client socket connection to be closed.

Due to network protocol requirement, sometime my server application is required to leave client socket connection open after server application done sending data to client (the client will be responsible to close socket connection). In this condition, it becomes problematic, not freeing socket stream leading to memory leak, but freeing socket cause server application not conform network protocol.

How do I solve this without need to create new classes inherited from TInetServer/TUnixServer and also TInetSocket/TUnixSocket?

I solved it by implementing my own socket server. See my related post,45972.0.html
« Last Edit: July 13, 2019, 12:12:36 pm by zamronypj »
Fano Framework, Free Pascal web application framework
Personal Projects


TinyPortal © 2005-2018