public void TestTuringSocket() { using (TuringSocket server = TuringSocket.Bind(new IPEndPoint(IPAddress.Any, 9787))) { server.OnMessage += Server_OnMessage; using (TuringSocket client = TuringSocket.ConnectTo(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9787))) { client.OnMessage += Client_OnMessage; client.SendMessage(new OpenStreamMessageRequest() { }); for (int x = 0; x < 20 && !isOk; x++) { Thread.Sleep(1000); } } } if (!isOk) { throw (new System.Exception()); } }
/// <summary> /// Start logic /// </summary> public bool Start() { Stop(); _State = EFuzzerState.Started; _Socket = TuringSocket.Bind(Listen); _Socket.OnMessage += _Socket_OnMessage; return(true); }