[twsocket] Help with stalling ftp client
Hi, I have been using the ftp client component for a couple of years now without a hitch. Until recently. The version is 7.09. I have in the main thread a timer that runs a state machine to control logging in and sending of the files. But recently, the state machine stalls and times out. I have logged the debug from the component, and you can see two successful sends, and the last one fails. In the failed send, the STOR is issued, but the 150 Opening ASCII ... does not happen. This is as a result of calling PutAsync on the component. Now before I dust off wireshark, does anybody know what could cause the 150 after the STOR command? debug Sending to server: 17012012_1315390_leeEcersley.csv PASV 227 Entering Passive Mode (65,212,180,79,135,10) ! Upload Size 91 STOR 17012012_1315390_leeEcersley.csv 150 Opening ASCII mode data connection for 17012012_1315390_leeEcersley.csv 226 Transfer complete ! 91bytes received/sent in 360 milliseconds Request 18 Done. StatusCode = 226 LastResponse was : '226 Transfer complete' Sending to server: 17012012_1317030_leeEcersley.csv PASV 227 Entering Passive Mode (65,212,180,79,156,230) ! Upload Size 91 STOR 17012012_1317030_leeEcersley.csv 150 Opening ASCII mode data connection for 17012012_1317030_leeEcersley.csv 226 Transfer complete ! 91bytes received/sent in 360 milliseconds Request 18 Done. StatusCode = 226 LastResponse was : '226 Transfer complete' Sending to server: 17012012_1319010_leeEcersley.csv PASV 227 Entering Passive Mode (65,212,180,79,238,1) ! Upload Size 91 STOR 17012012_1319010_leeEcersley.csv /debug Thanks, Andy -- 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] Help with stalling ftp client
Info2004 wrote: PASV 227 Entering Passive Mode (65,212,180,79,238,1) ! Upload Size 91 STOR 17012012_1319010_leeEcersley.csv /debug I guess the server did not send a response to the STOR request after the client successfully established the data connection. Since this is async mode your application should have detected and handled a request timeout. -- Arno Garrels -- 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] OnDataAvailable
If the ClientSocket is closed, the callback for OnDataAvailable is triggered and the missing Bytes are received. This is the common sympton of missing line endings so the event is never called. But this would not explain why it's suddenly happening. I gave up on LineMode a long time ago, and now build lines myself with a timeout so a partial line is processed after x seconds. Angus -- 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] OnDataAvailable
I had a similar problem when converting to XE2 from Delphi7 - my TwSocket component was designed to send a header string containing the length of the data to follow, and then I would read that bit to get the actual data - and then process it - but with XE2 being unicode aware - suddenly I had extra characters in the actual transmitted message - so the counter at the beginning of the data did not match the actual data - and therefore there was still stuff to receive (still in the buffer) so it hung the client up. Regards Brian On Wed, Feb 1, 2012 at 4:20 AM, mfisc...@bfe.tv wrote: Hi, i am using the Standard TWSocket in a Server and round about 5 Clients without LineMode. After a Client is connected to the Server, the Client starts immediately to send text messages. After some sort of filtering the messages are broadcasted to a subset of all connected Clients. If i start the sever and 5 clients through a script on a single Windows 7 PC the following error occurs: After a few Bytes are exchanged one or two of the clients no longer call the callback function for OnDataAvailable. The ServerSocket and and the ClientSocket stay in state wsConnected. If i look at WireShark the Data is still transmitted from Server to Client. If the ClientSocket is closed, the callback for OnDataAvailable is triggered and the missing Bytes are received. Any idea in which direction my problem could be located? Thanks, M. Fischer -- 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 -- 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] Help with stalling ftp client
On 31/01/2012 17:41, Arno Garrels wrote: I guess the server did not send a response to the STOR request after the client successfully established the data connection. Since this is async mode your application should have detected and handled a request timeout. Arno, What is the correct way to handle this scenario? Can I issue another PutAsync, or will I need to close the connection and start again? Regards, Andy -- 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] Help with stalling ftp client
On 31/01/2012 19:05, Brian Culverwell wrote: probably your backend ftp server has been changed to 'binary' type - and when receiving your request to STOR the .csv file - it is issuing a type A to change the mode to ASCII You could force the Type A before issuing your STOR. Brian, Do you mean to set ascii initially after logging on, or before each STOR (PutAsync) ? Regards, Andy -- 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] Reading e-mail
I think I have understood little or nothing. We summarize. I have to read e-mail. I read the first post and everything is ok (they are executed properly onheaderend events, onmessageend, ... Step to read any other message (which exists) is not getting any error message but still displays the information of the first message and events are not executed. Why? I would not ask stupid questions -- 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] Reading e-mail
We summarize. I have to read e-mail. I read the first post and everything is ok (they are executed properly onheaderend events, onmessageend, ... Step to read any other message (which exists) is not getting any error message but still displays the information of the first message and events are not executed. Why? Are you using your own code or the demo delivered with ICS ? If not using the demon first try with it and if it doesn't work, please report EXACTLY the steps you are doing. -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) 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
Re: [twsocket] Reading e-mail
Imposed on the host, user, password, etc.. I run in order opensync, statsync, listsync, uidlsync, and retrsync quitsync. It 's always the same procedure only changes the value of msgnum course. When you start running with msgnum = 1 is ok. Any value set does not produce results, and then I noticed that the code related to events and oinheaderend onmessageend no longer runs. There are 383 posts as evidenced by the value of msgcount. -- 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] Help with stalling ftp client
before each STOR On Wed, Feb 1, 2012 at 6:27 AM, Info2004 info2...@asamicros.com wrote: On 31/01/2012 19:05, Brian Culverwell wrote: probably your backend ftp server has been changed to 'binary' type - and when receiving your request to STOR the .csv file - it is issuing a type A to change the mode to ASCII You could force the Type A before issuing your STOR. Brian, Do you mean to set ascii initially after logging on, or before each STOR (PutAsync) ? Regards, Andy -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-**bin/mailman/listinfo/twsockethttp://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at 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
Re: [twsocket] Help with stalling ftp client
OK. Thanks. On 31/01/2012 21:46, Brian Culverwell wrote: before each STOR On Wed, Feb 1, 2012 at 6:27 AM, Info2004info2...@asamicros.com wrote: On 31/01/2012 19:05, Brian Culverwell wrote: probably your backend ftp server has been changed to 'binary' type - and when receiving your request to STOR the .csv file - it is issuing a type A to change the mode to ASCII You could force the Type A before issuing your STOR. Brian, Do you mean to set ascii initially after logging on, or before each STOR (PutAsync) ? Regards, Andy -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-**bin/mailman/listinfo/twsockethttp://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at 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 -- 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] Help with stalling ftp client
Info2004 wrote: On 31/01/2012 17:41, Arno Garrels wrote: I guess the server did not send a response to the STOR request after the client successfully established the data connection. Since this is async mode your application should have detected and handled a request timeout. Arno, What is the correct way to handle this scenario? Use a timer and reset some timeout value whenever data is sent and received, on timeout I'd abort the connection and retry. Can I issue another PutAsync, or will I need to close the connection and start again? I would abort and start a new fresh session after some wait time until a MaxRetry value is reached, increasing the wait before each retry. -- Arno Garrels -- 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] Help with stalling ftp client
Brian Culverwell wrote: probably your backend ftp server has been changed to 'binary' type - and when receiving your request to STOR the .csv file - it is issuing a type A to change the mode to ASCII A server doesn't issue commands, regardless of which type is active the upload should basically work. Setting the binary type is only important with non-Windows servers and not setting it will just corrupt non-text data. -- Arno Garrels -- 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