Re: Send event with 0 bytes
You don't send events, you send bytes. Thus, a send of 0 bytes will not put any bytes on the wire, and nothing will be received by the recipient.
On the other hand, for connectionless sockets (SOCK_DGRAM), a call to sendto with a length of zero is permissible and will return zero as a valid value. A zero-length transport datagram (i.e., a zero-length message surrounded by IP headers) is sent, and will be received as such by the receiver using recvfrom. See "sendto Function" at http://msdn.microsoft.com/en-us/libr...48(VS.85).aspx
Incidentally, the handshaking you describe (where the client signals "I'm ready" to the server before the server will deliver data) will slow the transfer of data considerably. Try to avoid this type of handshaking, since it results in inefficiencies.
Mike