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