コード例 #1
0
ファイル: Server.cs プロジェクト: hedfun2/File-Transfer-.NET
 public Server(int port)
 {
     window = new MainWindow();
     window.Show();
     window.giveServer(this);
     this.serverPort = port;
     serverListener = new TcpListener(getLocalIp(), port);
     window.setConnectedText("Listening For Clients");
     listenForClients();
 }
コード例 #2
0
ファイル: Server.cs プロジェクト: hedfun2/File-Transfer-.NET
 public Server(IPAddress serverIp, int port)
 {
     window = new MainWindow();
     window.Show();
     window.giveServer(this);
     this.serverIp = serverIp;
     this.serverPort = port;
     fileConnection = new TcpClient();
     messageConnection = new TcpClient();
     window.setConnectedText("Attempting to Connect to: " + serverIp.ToString() + ":" + port);
     Thread connectToServerThread = new Thread(new ThreadStart(connectToServer));
     connectToServerThread.Start();
     connectToServerThread.IsBackground = true;
 }