The net subsystem supports non-blocking sockets and asynchronous send/receive. Unfortunately, net/socket.c doesn't fully take advantage of that yet.
This patch series makes send asynchronous and drops code that will spin when the non-blocking socket would block. Also take advantage of qemu_set_fd_handler2()'s IOCanReadHandler so that we don't read packets from the socket when our peer is unable to receive. Stefan Hajnoczi (3): net: asynchronous send/receive infrastructure for net/socket.c net: EAGAIN handling for net/socket.c UDP net: EAGAIN handling for net/socket.c TCP net/socket.c | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 109 insertions(+), 13 deletions(-) -- 1.7.10.4