Connects to sockets