I'm developing a TCP/IP server in Delphi 2007 with INDY10. The server is activated and a lot of client are connected to him on a GPRS way, around 150; the clients must remain connected all the time but there are communication problems which not allow this, then they can connect to the server for a long time but somehow the communication fails after a while. The server must manage all the communication and the list of context that represents the clients; also it must free memory when it disconnects a socket or a context but it does'nt do it. The server is working about 3-4 hours correctly and then it begins to accumulate memory, cpu usage, and threads.
My real question is: in Indy10, what is the correct way to free memory and threads, close sockets on the different disconnections if I'm working with context?
Start Free Trial