private static void _testServer_DataAvailable(object sender, FDA.TCPServer.TCPCommandEventArgs e) { // when data is received on the test server, echo it back string received = Encoding.UTF8.GetString(e.Data); _testServer.Send(e.ClientID, received); }
public static void Flush() { _cts?.Cancel(); string text; lock (_sb) { if (_sb.Length == 0) { return; } text = _sb.ToString(); _sb.Clear(); } //Console.Write(text); _TCPServer.Send(Guid.Empty, text); }