I am working with a modified version of the sockets example that incorporates HTTP Post. The problem that I am having is determining at which point all the data has been written to the socket and socket has been flushed, so that I can close the connection to the webserver. Idealy I would like to be able to generate an event on that, instead of polling for it.
I managed to solve a similar problem of determining when the socket connection had been established before starting the transmission by using a callback event. I just don't know at which point to add the event for the closing of the socket.
Keep in mind that the call to write to the socket is a non-blocking call.