public void start() { Listener = new TcpListener(IPAddress.Any, port); Listener.Start(); // Запускаем его serverListener = new ServerListener(Listener, chatForm); Thread backgroundThread = new Thread(new ThreadStart(serverListener.listenNewUser)); backgroundThread.Start(); }
public UserChat(UserInfo userInfo, ChatForm chatForm, ServerListener serverListener=null) { this.userInfo = userInfo; this.chatForm = chatForm; this.serverListener = serverListener; }