in reply to Re^2: Sockets and threads, oh my!
in thread Sockets and threads, oh my!
I can assure you that the code I posted works using AS811/AS817 under XP.
As for the "full-duplex" thing, that is a confusing term when applied to communications over tcp connections. Both ends can transmit simultaneuosly because the buffering and handshaking (ack & nacks) are taken care of at the ip level. Whether one end can both send and receive simultaneously on different threads really depends upon the implementation.
What I can tell you is that under XP, if the socket is in blocking mode, attempts to send and receive are serialised by the runtime. Ie. If one thread is currently in a blocking read, no other thread will be able to send until the read is satisfied or it times out. In non-blocking mode, the same is true, but if you use sysread, it will only fetch however much is currently available at the interface and return immediately. Even if nothing is available. The error code I mention in the code indicates that an incomplete read has returned early.
Whether sockets operate this way on other platforms I do not know.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Sockets and threads, oh my!
by KevinZwack (Chaplain) on Jun 20, 2006 at 17:19 UTC |