Hello David, Glad it works for you now :)
> and not by me. I wasn't expecting this data "Welcome to TcpSrv" so You can switch this off if you want. Just before you call Listen you do: Srv.Banner := ''; > isn't sent until the buffers were full. > TWSocketOptions( ) << wsoTcpNoDelay; Not needed. Nagle algoritm just wait some milliseconds to send just in case tehre is something else to send. I recall typically 100 ms. Switching off nagle will let your data send a little faster but it slow down network performance. > fine, although I am getting some extraneous OnDataSent & OnDataAvailable I dont understeand. Can you please reprase ? > Is there a guide to what calls should happen when based on the > components? Not a real guide, but please check on my site the FAQ and the HELP documents for TWSocket. > I'm guessing that certain information is being sent by the component on > connectino & disconnection which is causing these extra events to > happen, but I would like to understand them so I can handle them properly. There is no extra data sent by the component. TWSocket does not add anything to your data. Events are fired as follow (client side) when you call Connect: - OnSessionConnected (eventually with winsock error). - OnSessionClosed (if OnSessionConnected has error) (eventually with winsock error). - OnDataAvailable (but nothing to receive, but depending on OS) Then session is started. --- Rgds, Wilfried http://www.mestdagh.biz Wednesday, September 7, 2005, 14:58, David Lewis wrote: > Further investigation has solved a few things... > I was getting a ltitle confused by the data being sent by the component, > and not by me. I wasn't expecting this data "Welcome to TcpSrv" so > wasn't ready to handle it. > I was also a little off-target by expecting my data to be sent at the > time I used the Send( ) method. I forgot about the MCU and that data > isn't sent until the buffers were full. > So... > I now am using : > TWSocketOptions( ) << wsoTcpNoDelay; > To get the data sent when I need it sent (I am using very small messages) > I now accept the "Welcome to TcpSrv" message and ignore it, waiting for > the real data to be recevied. > Once everything is complete, I call Close( ) on the client. > The other problem I was having (Second time round failure to connect) > was because I was resetting the Addr & Port before the Send( ) method > and not before the Connect( ) method. Now things seem to be working > fine, although I am getting some extraneous OnDataSent & OnDataAvailable > calls that I don't fully understand. > Is there a guide to what calls should happen when based on the > components? As in the correct sequence on Event calls for when Client > connects & disconnects? > I'm guessing that certain information is being sent by the component on > connectino & disconnection which is causing these extra events to > happen, but I would like to understand them so I can handle them properly. > Dave -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be