Re: [twsocket] Ftp freezing

2009-07-15 Thread Arno Garrels
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


Re: [twsocket] Ftp freezing

2009-07-15 Thread Francois Piette
 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 ,

There is no reason inside ICS which could freeze the program since it uses
async operation. Please try the same upload using FtpTst sample application
delivered with ICS to see if it comes from your own coding. If it occurs
with FtpTst, then do some more testing:
1) Try on several other computers
2) Check your security products such as firewall, anti malware and similar.
Some are bugged and make async winsock operation blocking !

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?

This would be just a work around. You should be find the root cause and
suppress it.

--
francois.pie...@overbyte.be
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be

--
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


[twsocket] Ftp freezing

2009-07-14 Thread New Era
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 ,

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