Add spec for writing to sockets