static private void Accept(object main) { ServerMainWindow mainWindow = (ServerMainWindow)main; while (accept) { try { User newUser = new User(mainWindow); newUser.connection(server.Accept(), folderPath); } catch { if (terminating) { accept = false; } else { Console.Write("Listening socket has stopped working...\n"); } } } }
public User(ServerMainWindow caller) { mainWindow = caller; }