Example #1
0
        internal UnixSocket OpenAbstractUnix(string path)
        {
            byte[]     sa     = GetSockAddrAbstract(path);
            UnixSocket client = new UnixSocket();

            client.Connect(sa);
            return(client);
        }
        public UnixSocket OpenUnix(string path)
        {
            byte[] p = Encoding.Default.GetBytes(path);

            byte[] sa = new byte[2 + p.Length + 1];

            //we use BitConverter to stay endian-safe
            byte[] afData = BitConverter.GetBytes(UnixSocket.AF_UNIX);
            sa[0] = afData[0];
            sa[1] = afData[1];

            for (int i = 0; i != p.Length; i++)
            {
                sa[2 + i] = p[i];
            }
            sa[2 + p.Length] = 0;             //null suffix for domain socket addresses, see unix(7)

            UnixSocket client = new UnixSocket();

            client.Connect(sa);

            return(client);
        }
        protected UnixSocket OpenAbstractUnix(string path)
        {
            byte[] p = Encoding.Default.GetBytes(path);

            byte[] sa = new byte[2 + 1 + p.Length];

            //we use BitConverter to stay endian-safe
            byte[] afData = BitConverter.GetBytes(UnixSocket.AF_UNIX);
            sa[0] = afData[0];
            sa[1] = afData[1];

            sa[2] = 0;             //null prefix for abstract domain socket addresses, see unix(7)
            for (int i = 0; i != p.Length; i++)
            {
                sa[3 + i] = p[i];
            }

            UnixSocket client = new UnixSocket();

            client.Connect(sa);

            return(client);
        }
Example #4
0
		public UnixSocket OpenUnix (string path)
		{
			byte[] p = Encoding.Default.GetBytes (path);

			byte[] sa = new byte[2 + p.Length + 1];

			//we use BitConverter to stay endian-safe
			byte[] afData = BitConverter.GetBytes (UnixSocket.AF_UNIX);
			sa[0] = afData[0];
			sa[1] = afData[1];

			for (int i = 0 ; i != p.Length ; i++)
				sa[2 + i] = p[i];
			sa[2 + p.Length] = 0; //null suffix for domain socket addresses, see unix(7)

			UnixSocket client = new UnixSocket ();
			client.Connect (sa);

			return client;
		}
Example #5
0
		protected UnixSocket OpenAbstractUnix (string path)
		{
			byte[] p = Encoding.Default.GetBytes (path);

			byte[] sa = new byte[2 + 1 + p.Length];

			//we use BitConverter to stay endian-safe
			byte[] afData = BitConverter.GetBytes (UnixSocket.AF_UNIX);
			sa[0] = afData[0];
			sa[1] = afData[1];

			sa[2] = 0; //null prefix for abstract domain socket addresses, see unix(7)
			for (int i = 0 ; i != p.Length ; i++)
				sa[3 + i] = p[i];

			UnixSocket client = new UnixSocket ();
			client.Connect (sa);

			return client;
		}