private void tcpServer1_OnDataAvailable(TcpServer.TcpServerConnection connection) { byte[] data = readStream(connection.Socket); if (data != null) { string dataStr = Encoding.ASCII.GetString(data); invokeDelegate del = () => { logData(false, dataStr); }; Invoke(del); data = null; } }
private void tcpServer1_OnConnect(TcpServer.TcpServerConnection connection) { invokeDelegate setText = () => lblConnected.Text = tcpServer1.Connections.Count.ToString(); Invoke(setText); }