TCP Problem

24 Dec 2010

good morning everyone!


this is my first time posting and I actually don't know how to use this forum very well, sorry...


well I'm trying to send some data through the TCP protocol using the tcpsocket.h as the example, but unhappily it is not working to me, the  Mbed connects to the internet and also connect to the "tcp server socket" but it does not send any message, just connect and close the socket.

could anyone please help me???

I've published my source:
http://mbed.org/users/brleme/programs/TCP/ljwl93

thank you in advance

25 Dec 2010

It's Christmas Eve night and I shouldn't be looking at this right now. However, I'm responding because I struggled with this as well. I suspect your event's handler is not catching all the cases and may be closing the socket itself, but this is just a guess.  Build out your events handler with printfs to see exactly what is happening.  My work around for debug purposes was to turn off the events handler with the resetOnEvent (or something close to that) command after I had established a connection.  You can also establish connections etc.. without the events handler working, but I would put delays into the SW to make sure the connection is made before you send.  I was able to send messages to the server without any problem after I did either of these choices. Needless to say, full event handling is needed in the long run for stable SW. By the way, which server SW are you using e.g., Hercules or Putty?

Chris Strolle