New Era wrote: > I am using tftpcli in passive mode to upload files, while uploading a > file, for some reason if a connection problem occurs in the middle of > the transfer, the program freezes ,
That should not happen! ICS will never actually freeze your application, though with very fast transfers it happens that the GUI freezes since Windows puts WM_PAINT messages into the message queue only when the queue is empty. So it's IMO a good idea to use a worker thread to keep your GUI responsive. In order to detect timeouts you do not need a worker thread, just use a TTimer to check whether something was received or sent in intervals. In OnProgress event you could simply set a flag which is reset in OnTimer event. -- Arno Garrels > > to overcome this problem I thought that I can, > > - Create a thread to make the ftp transfer > - Assign OnProgress event, and in this event handler PostMessage to > the main application window, > - In main thread if message from thread does not come for long time, > kill the thread and restart the uploading by creating another thread > instance. > > Is this approach is a proper solution or what would you suggest? > Best Regards, -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be