コード例 #1
0
 protected PeerBase(Guid guid, TcpClient tcpClient, Server server)
 {
     this.guid = guid;
     this.tcpClient = tcpClient;
     this.server = server;
     Task.Run(()=>PeerMain());
 }
コード例 #2
0
 public ExecutionServer(int port)
 {
     this.port = port;
     hostname = Dns.GetHostName();
     //foreach (IPAddress ip in Dns.GetHostEntry(hostname).AddressList)
     //{
     //    Console.WriteLine(ip);
     //}
     //Console.WriteLine("Input the IP:");
     //serverIP = IPAddress.Parse(Console.ReadLine());
     serverIP = Dns.GetHostEntry(hostname).AddressList.First(x=>x.AddressFamily == AddressFamily.InterNetwork);
     server = new Server();
     server.logger.Info(serverIP.ToString());
     isTerminated = false;
     serverListener = new TcpListener(serverIP, port);
     peerDictionary = new Dictionary<Guid, PeerBase>();
     AcceptConnection();
 }
コード例 #3
0
ファイル: Peer.cs プロジェクト: DSobscure/MonopolyOnlineGame
 public Peer(Guid guid, TcpClient tcpClient, Server server)
     : base(guid, tcpClient, server)
 {
 }