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; }
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(); }