public Socket ConnectTo() { if (_unixSocketPath != null) { var client = Socket.Create(AF_UNIX, SOCK_STREAM, 0, blocking: true); client.Connect(_unixSocketPath); return(client); } else if (_serverAddress != null) { var client = Socket.Create(AF_INET, SOCK_STREAM, IPPROTO_TCP, blocking: true); client.SetSocketOption(SOL_TCP, TCP_NODELAY, 1); client.Connect(_serverAddress); return(client); } else { return(null); } }