Not waiting before writing to a socket