Further to this I have discovered that this is only a problem when the ClientType is non blocking. It seems that the control opens up a new thread which remains open even when I close the socket. In fact looking at the IDE it seems that a new thread is started each time I open a socket. How do I get it to close the thread when I close the connection. John Barrat
_____ From: John Barrat [mailto:[EMAIL PROTECTED] Sent: 29 September 2006 10:52 To: 'Borland's Delphi Discussion List' Subject: Advice on Closing TtcpClient I have built a control which embodies a TtcpClient control as a sub-control. In my test application for the control I have found that if I close the application while the socket is still connected the application does not close. The form dissappears but it remains as a running process in task manager. What is the safe way of closing this process? I have tried things like While Socket.Connected do socket.close but that doesn't seem to allow a clean shutdown. This is my first attempt at a control so applogies if the question is a bit naive. John Barrat _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

