public PeerCred (Socket sock) { if (sock.AddressFamily != AddressFamily.Unix) { throw new ArgumentException ("Only Unix sockets are supported", "sock"); } data = (PeerCredData)sock.GetSocketOption (SocketOptionLevel.Socket, (SocketOptionName)so_peercred); }
public PeerCred(Socket sock) { if (sock.AddressFamily != AddressFamily.Unix) { throw new ArgumentException("Only Unix sockets are supported", "sock"); } this.data = (PeerCredData)sock.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Debug | SocketOptionName.DontRoute | SocketOptionName.OutOfBandInline | SocketOptionName.IPOptions | SocketOptionName.DropSourceMembership | SocketOptionName.BlockSource | SocketOptionName.NoDelay | SocketOptionName.NoChecksum); }
public PeerCred(Socket sock) { if (sock.AddressFamily != AddressFamily.Unix) { throw new ArgumentException("Only Unix sockets are supported", "sock"); } data = (PeerCredData) sock.GetSocketOption(SocketOptionLevel.Socket, (SocketOptionName)so_peercred); }
public PeerCred(Socket sock) { if (sock.AddressFamily != AddressFamily.Unix) { throw new ArgumentException("Only Unix sockets are supported", "sock"); } object?opt = sock.GetSocketOption(SocketOptionLevel.Socket, (SocketOptionName)so_peercred); if (opt != null) { data = (PeerCredData)opt; } else { data.pid = -1; data.uid = -1; data.gid = -1; } }