コード例 #1
0
        /// <summary>
        /// 初始化Peer
        /// </summary>
        /// <param name="socket">连接的Socket</param>
        public Peer(Socket socket)
        {
            this.socket      = socket;
            this.NS          = new NetworkStream(socket);
            this.Information = new PeerInformation(socket.RemoteEndPoint);
            peers.Add(this);
            this.addInto(Group.BroadCast);
            this.isActive = true;
            Thread t = new Thread(new ThreadStart(ReceiveProcess));

            t.IsBackground = true;
            t.Start();
        }
コード例 #2
0
ファイル: Peer.cs プロジェクト: burstinair/burst.net
 /// <summary>
 /// 初始化Peer
 /// </summary>
 /// <param name="socket">连接的Socket</param>
 public Peer(Socket socket)
 {
     this.socket = socket;
     this.NS = new NetworkStream(socket);
     this.Information = new PeerInformation(socket.RemoteEndPoint);
     peers.Add(this);
     this.addInto(Group.BroadCast);
     this.isActive = true;
     Thread t = new Thread(new ThreadStart(ReceiveProcess));
     t.IsBackground = true;
     t.Start();
 }