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.


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.

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

Reply via email to