示例#1
0
 private void dead(object source, ElapsedEventArgs e)
 {
     peer.removeDeadPeer(this.info.getID());
     this.isAliveTimer.Stop();
     this.socket = null; this.info = null; this.isAliveTimer = null; this.peer = null;
 }
示例#2
0
 public PeerHandler(Socket socket, PeerInfo info, Peer peer)
 {
     this.peer = peer;
     this.socket = socket;
     this.info = info;
     this.isAlive = true;
     this.isAliveTimer = new System.Timers.Timer(GameConstant.connectionTimeOut);
     this.isAliveTimer.Elapsed += new ElapsedEventHandler(dead);
     this.isAliveTimer.Start();
 }