in reply to Re^11: UDP connection
in thread UDP connection
my main goal was to show bidirectional communication was possible,
Bidirectional communication was never in question (by me).
My questions/concerns related to concurrent bidirectional comms (at the same endpoint), which AFAIK is impossible on any platform.
Of course, this never arises with the select loop mechanism, as there is only one thread of execution and it is either waiting; or processing a can_read state; or processing a can_write state; or an error state.
But with either a multi-threaded, or multi-process solution on multi-core hardware, it can be attempted -- as exampled by the idea that the client run one thread/process for doing the heartbeat and another for receiving the data -- and needs to be handled.
It can be handled (with threading at least), but unless the OP comes back and fills in a few of the blanks, there's probably little point in further pursuing the possibilities.