Hello,

when the FTP server is running on the same machine as an ICS v7 client,
occasionally a hang can occur when receiving data, such as after a
LIST command.

The hang ends with a timeout.

The reason seems to be that the data is received faster than ICS
expects it. In such cases, TCustomWSocket.Do_FD_CLOSE and 
TCustomFtpCli.DataSocketGetDataAvailable are invoked in the wrong
order.

Normally I see DataSocketGetDataAvailable being called first and
then Do_FD_CLOSE. But in some cases, it is the other way around!

Below you will find a log of events. I have added a lot of stuff
here, so it looks a bit different from the standard logging but 
I think you can read it. This all happens in the main thread.
No multi-threading is involved.

Any ideas how this problem can be solved?

21.06.2010 12:52:50 MSG:< 227 Entering Passive Mode (127,0,0,1,202,16)
21.06.2010 12:52:50 StateChange, NewState=9 PASV Ready, OldState=8 Waiting 
Response
21.06.2010 12:52:50 TriggerRequestDone, ErrCode=0 FRequestDoneFlag=FALSE
21.06.2010 12:52:50 DebugLog:! HighLevelAsync 0
21.06.2010 12:52:50 DebugLog:! Data Socket Connect
21.06.2010 12:52:50 DebugLog:TWSocket will connect to 127.0.0.1:51728
21.06.2010 12:52:50 StateChange, NewState=8 Waiting Response, OldState=9 PASV 
Ready
21.06.2010 12:52:50 MSG:> LIST -al
21.06.2010 12:52:50 SendCommand LIST -al
21.06.2010 12:52:50 DebugLog:05F1FCE0 PutDataInSendBuffer 1000  len 10 [1640]
21.06.2010 12:52:50 DebugLog:05F1FCE0 TryToSend 1000
21.06.2010 12:52:50 TCustomFtpCli.ControlSocketDataAvailable with ErrCode=0
21.06.2010 12:52:50 Data Len = 42
21.06.2010 12:52:50 DebugLog:>|150 Connection accepted|
21.06.2010 12:52:50 MSG:< 150 Connection accepted
21.06.2010 12:52:50 DebugLog:>|226 Transfer OK|
21.06.2010 12:52:50 MSG:< 226 Transfer OK
21.06.2010 12:52:50 DebugLog:! Next3GetAsync
21.06.2010 12:52:50 TCustomFtpCli.ControlSocketDataAvailable with ErrCode=0
21.06.2010 12:52:50 Data Len = -1
21.06.2010 12:52:50 Data Len < 0
21.06.2010 12:52:50 FD_CLOSE 1052
21.06.2010 12:52:50 Do_FD_CLOSE, State=3
21.06.2010 12:52:50 DebugLog:! Data Session Connected (Get)
21.06.2010 12:52:50 DataSocketGetDataAvailable with ErrCode=0
21.06.2010 12:52:50 DataSocketGetDataAvailable Len: 333
21.06.2010 12:52:50 DebugLog:05F1DDE0 TryToSend 1052
21.06.2010 12:52:50 DebugLog:05F1DDE0 TriggerDataSent 1052
21.06.2010 12:52:50 DebugLog:05F1FCE0 TryToSend 1000
21.06.2010 12:52:50 DebugLog:05F1FCE0 TriggerDataSent 1000

Cheers,
Tobias

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

Reply via email to