Пример #1
0
		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);
		}
Пример #2
0
 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);
 }
Пример #3
0
        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);
        }
Пример #4
0
        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;
            }
        }