Connecting to a server with batch sockets