public Client this[Wo1fSocket Socket]
 {
     get
     {
         foreach (Client C in Clients)
         {
             if (C.uid == Socket.uid)
                 return C;
         }
         return null;
     }
 }
Beispiel #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();
 }
Beispiel #3
0
 public Client this[Wo1fSocket Socket]
 {
     get
     {
         foreach (Client C in Clients)
         {
             if (C.uid == Socket.uid)
             {
                 return(C);
             }
         }
         return(null);
     }
 }
Beispiel #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);
        }
Beispiel #5
0
 public Client()
 {
     WS = new Wo1fSocket();
     Init();
 }
Beispiel #6
0
 public Client(System.Net.Sockets.TcpClient tcpClient)
 {
     // TODO: Complete member initialization
     this.WS = new Wo1fSocket(tcpClient);
     Init();
 }
Beispiel #7
0
 public Client(Wo1fSocket Socket)
 {
     this.WS = Socket;
     Init();
 }
Beispiel #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;
        }
Beispiel #9
0
 public Client()
 {
     WS = new Wo1fSocket();
     Init();
 }
Beispiel #10
0
 public Client(System.Net.Sockets.TcpClient tcpClient)
 {
     // TODO: Complete member initialization
     this.WS = new Wo1fSocket(tcpClient);
     Init();
 }
Beispiel #11
0
 public Client(Wo1fSocket Socket)
 {
     this.WS = Socket;
     Init();
 }