threadsafe winsock handling.