private void tcpServer1_OnConnect(tcpServer.TcpServerConnection connection) { invokeDelegate setText = () => lblConnected.Text = tcpServer1.Connections.Count.ToString(); Invoke(setText); while (tcpServer1.Connections.Count != 0) { toolStripStatusLabel4.Text = "Connection: 1 !"; toolStripStatusLabel4.BackColor = Color.Lime; } }
private void tcpServer3_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 static void tcpServer1_OnDataAvailable(tcpServer.TcpServerConnection connection) { if (connection == null) { return; } else if (connection.Socket == null) { return; } byte[] data = readStream(connection.Socket); if (data != null) { string dataStr = Encoding.ASCII.GetString(data); logData(false, dataStr); data = null; } }
private void tcpServer4_OnConnect(tcpServer.TcpServerConnection connection) { invokeDelegate setText = () => lblConnected4.Text = tcpServer4.Connections.Count.ToString(); Invoke(setText); }
private static void tcpServer1_OnConnect(tcpServer.TcpServerConnection connection) { //invokeDelegate setText = () => lblConnected.Text = tcpServer1.Connections.Count.ToString(); Console.WriteLine("connect count:" + tcpServer1.Connections.Count.ToString()); //Invoke(setText); }