I've often found myself wanting to test various nonblocking socket code, but I'm unsure how to simulate (or otherwise intentionally cause) an event to test nonblocking reads/writes and the various buffers in play - in other words, to cause a 'blocking event' on a given socket.
How would this be done? I imagine that this would require low level control over the TCP session in order to intentionally cause an EWOULDBLOCK error on the receiving socket