stubbing sockets and io