TCP socket Events

18 Apr 2011

Hi, I´m using the TCPSocket library. When I receive something, the event WRITEABLE occurs and I´d wanted to know if it is possible , after recv, to send something inside the case of TCPSocket_WRITEABLE envent... Thanks for your help and regards, María.

18 Apr 2011

Yes, you can do this. But you still need to call Net:poll() outside of the event handler, so you will need some code in your main loop. Thats why most TCP programs use the event handler for signaling the current state to a main loop, which does the heavy lifting.

18 Apr 2011

The event WRITEABLE occurs when you send data and not when you receive!

10 May 2011

Yes, I meant that. WRITEABLE event occurs after a send always? I mean, the way to know if a send was executed correctly is seeing if the WRITEABLE event occurs (suposing that I don´t receive anything on the other side). thanks