private void ConnectionRequested(IAsyncResult ar) { connection = new ChatClientModel(server.EndAcceptSocket(ar)); connection.IncomingLineEvent += connection_IncomingLineEvent; if (newConnection != null) { newConnection(true); } server.BeginAcceptSocket(ConnectionRequested, null); heartbeatTimer.Change(1000, 1000); }
public Form1() { InitializeComponent(); model = new ChatClientModel(); model.IncomingLineEvent += MessageReceived; }