예제 #1
0
 public GeneralSocket(System.Net.Sockets.AddressFamily addressFamily,
                      System.Net.Sockets.SocketType socketType,
                      System.Net.Sockets.ProtocolType protocolType,
                      System.Net.EndPoint localEndPoint) : base(addressFamily, socketType, protocolType)
 {
     base.Bind(localEndPoint);
 }
예제 #2
0
        public override void Create(System.Net.Sockets.AddressFamily af, System.Net.Sockets.SocketType type, System.Net.Sockets.ProtocolType proto)
        {
            lock (m_syncRoot)
            {
                m_socket          = new ElServerSSLSocket(new Socket(af, type, proto));
                m_socket.Versions = m_protocols;

                // To speed the answer, we're using only the fastest cipher suites (based on experimentation ...)
                for (short i = SBSSLConstants.__Global.SB_SUITE_FIRST; i < SBSSLConstants.__Global.SB_SUITE_LAST; i++)
                {
                    m_socket.set_CipherSuites(i, false);
                }

                // let the user overide cipher suites if they desire
                if (m_config.Security.CipherList != null && m_config.Security.CipherList.Count > 0)
                {
                    foreach (var c in m_config.Security.CipherList)
                    {
                        m_socket.set_CipherSuites(c, true);
                    }
                }
                else
                {
                    m_socket.set_CipherSuites(SBSSLConstants.__Global.SB_SUITE_RSA_3DES_SHA, true);
                    m_socket.set_CipherSuites(SBSSLConstants.__Global.SB_SUITE_RSA_AES128_SHA, true);
                    m_socket.set_CipherSuites(SBSSLConstants.__Global.SB_SUITE_RSA_AES256_SHA, true);
                }

                m_socket.CustomCertStorage = m_certStorage;
                m_socket.OnError          += new SBSSLCommon.TSBErrorEvent(m_socket_OnError);
            }
        }
예제 #3
0
 public override void Create(System.Net.Sockets.AddressFamily af, System.Net.Sockets.SocketType type, System.Net.Sockets.ProtocolType proto)
 {
     lock (m_syncRoot)
     {
         m_socket = new Socket(af, type, proto);
     }
 }
예제 #4
0
 public Socket(ns.AddressFamily addressFamily, ns.SocketType socketType, ns.ProtocolType protocolType)
     : base(addressFamily, socketType, protocolType)
 {
     lock (_socklist)
     {
         _socklist.Add(FD, this);
     }
     //EDB.WriteLine("Making socket w/ FD=" + FD);
 }
예제 #5
0
 public Socket(ns.AddressFamily addressFamily, ns.SocketType socketType, ns.ProtocolType protocolType)
     : base(addressFamily, socketType, protocolType)
 {
     if (_socklist == null)
     {
         _socklist = new SortedList <uint, Socket>();
     }
     _socklist.Add(FD, this);
     //EDB.WriteLine("Making socket w/ FD=" + FD);
 }
예제 #6
0
        public CSADDR_INFO(BluetoothAddress local, BluetoothAddress remote, System.Net.Sockets.SocketType type, System.Net.Sockets.ProtocolType protocol)
        {
            //ensure zeros
            localAddr = IntPtr.Zero;
            localSize = 0;
            remoteAddr = IntPtr.Zero;
            remoteSize = 0;

            iSocketType = type;
            iProtocol = protocol;
            

            if (local != null)
            {
#if V1
                //have to use AllocHGlobal substitute
                localAddr = Marshal32.AllocHGlobal(40);
                Marshal.Copy(local.ToByteArray(), 0, new IntPtr(localAddr.ToInt32() + 8), 6);
#else
                localAddr = Marshal.AllocHGlobal(40);
                Marshal.WriteInt64(localAddr, 8, local.ToInt64());
#endif
                Marshal.WriteInt16(localAddr, 0, 32);                
                localSize = 40;
            }
            if (remote != null)
            {
#if V1
                remoteAddr = Marshal32.AllocHGlobal(40);
                Marshal.Copy(remote.ToByteArray(), 0, new IntPtr(remoteAddr.ToInt32() + 8), 6);
#else
                remoteAddr = Marshal.AllocHGlobal(40);
                Marshal.WriteInt64(remoteAddr, 8, remote.ToInt64());
#endif
                remoteSize = 40;
                Marshal.WriteInt16(remoteAddr, 0, 32);   
            }
        }
예제 #7
0
 public Socket(ns.AddressFamily addressFamily, ns.SocketType socketType, ns.ProtocolType protocolType)
     : this(new ns.Socket(addressFamily, socketType, protocolType))
 {
     //ROS.Debug()( $"[{ThisNode.Name}] Making socket w/ FD={FD}" );
 }
예제 #8
0
		public SocketDebug(System.Net.Sockets.AddressFamily family, System.Net.Sockets.SocketType type, System.Net.Sockets.ProtocolType proto, string name) : base(family, type, proto) {
			this.name = name;
		}
예제 #9
0
 public Socket(ns.AddressFamily addressFamily, ns.SocketType socketType, ns.ProtocolType protocolType)
     : this(new ns.Socket(addressFamily, socketType, protocolType))
 {
     //EDB.WriteLine("Making socket w/ FD=" + FD);
 }
예제 #10
0
 public override void Create(System.Net.Sockets.AddressFamily af, System.Net.Sockets.SocketType type, System.Net.Sockets.ProtocolType proto)
 {
     throw new NotImplementedException();
 }