Beispiel #1
0
        public void Start()
        {
            switch (Protocol)
            {
            case NetworkProtocol.Tcp:
            case NetworkProtocol.Http1:
            case NetworkProtocol.Http2:
                CurrSocket = new XSocket(AddressFamily, SocketType, ProtocolType.Tcp);
                break;

            case NetworkProtocol.Udp:
                CurrSocket = new XSocket(AddressFamily, SocketType, ProtocolType.Udp);
                break;
            }
            CurrSocket.Mode = ApplyMode.Client;
            ((ICilent)this).Open();
        }
        public void Start()
        {
            switch (Protocol)
            {
            case NetworkProtocol.Tcp:
            case NetworkProtocol.Http1:
            case NetworkProtocol.Http2:
                CurrSocket = new XSocket(AddressFamily, SocketType, ProtocolType.Tcp);
                break;

            case NetworkProtocol.Udp:
                CurrSocket = new XSocket(AddressFamily, SocketType, ProtocolType.Udp);
                break;
            }

            CurrSocket.Mode = ApplyMode.Server;
            CurrSocket.Bind(GetAddress());
            CurrSocket.Listen(MaxConnect);

            ((IServer)this).Open();
        }