Пример #1
0
 public Client this[Wo1fSocket Socket]
 {
     get
     {
         foreach (Client C in Clients)
         {
             if (C.uid == Socket.uid)
                 return C;
         }
         return null;
     }
 }
Пример #2
0
 static void Main(string[] args)
 {
     WS = new Wo1fSocket();
     Cmd = new Command();
     //WS.Connect();
     Cmd.Register("connect", new CommandDelegate(TryConnect));
     //Cmd.Register("dc", new CommandDelegate(TryDC));
     Thread T = new Thread(InputThread);
     T.IsBackground = true;
     T.Start();
     Application.Run();
 }
Пример #3
0
 public Client this[Wo1fSocket Socket]
 {
     get
     {
         foreach (Client C in Clients)
         {
             if (C.uid == Socket.uid)
             {
                 return(C);
             }
         }
         return(null);
     }
 }
Пример #4
0
        public bool Connect(string Host, int Port, bool Encrypt)
        {
            WS                   = new Wo1fSocket();
            WS.OnRecv           += new Wo1fSocket.PacketReceivedEventHandler(WS_ReceivedEvent);
            WS.OnConnectFail    += new Wo1fSocket.OnConnectFailEventHandler(WS_OnConnectFail);
            WS.OnDisconnect     += new Wo1fSocket.OnDisconnectEventHandler(WS_OnDisconnect);
            WS.OnConnectSuccess += new Wo1fSocket.OnConnectSuccessEventHandler(WS_OnConnectSuccess);

            bool ret = WS.Connect(Host, Port);

            WS.Encryption = Encrypt;
            CS.SysLog("Connect(" + Host + ", " + Port + "); returned " + ret.ToString() + ".");
            return(ret);
        }
Пример #5
0
 public Client()
 {
     WS = new Wo1fSocket();
     Init();
 }
Пример #6
0
 public Client(System.Net.Sockets.TcpClient tcpClient)
 {
     // TODO: Complete member initialization
     this.WS = new Wo1fSocket(tcpClient);
     Init();
 }
Пример #7
0
 public Client(Wo1fSocket Socket)
 {
     this.WS = Socket;
     Init();
 }
Пример #8
0
        public bool Connect(string Host, int Port, bool Encrypt)
        {
            WS = new Wo1fSocket();
            WS.OnRecv += new Wo1fSocket.PacketReceivedEventHandler(WS_ReceivedEvent);
            WS.OnConnectFail += new Wo1fSocket.OnConnectFailEventHandler(WS_OnConnectFail);
            WS.OnDisconnect += new Wo1fSocket.OnDisconnectEventHandler(WS_OnDisconnect);
            WS.OnConnectSuccess += new Wo1fSocket.OnConnectSuccessEventHandler(WS_OnConnectSuccess);

            bool ret = WS.Connect(Host, Port);
            WS.Encryption = Encrypt;
            CS.SysLog("Connect(" + Host + ", " + Port + "); returned " + ret.ToString() + ".");
            return ret;
        }
Пример #9
0
 public Client()
 {
     WS = new Wo1fSocket();
     Init();
 }
Пример #10
0
 public Client(System.Net.Sockets.TcpClient tcpClient)
 {
     // TODO: Complete member initialization
     this.WS = new Wo1fSocket(tcpClient);
     Init();
 }
Пример #11
0
 public Client(Wo1fSocket Socket)
 {
     this.WS = Socket;
     Init();
 }