private void ReceiveCallback(IAsyncResult ar) { StateObject state = (StateObject)ar.AsyncState; Socket client = state.workSocket; int bytesRead = client.EndReceive(ar); if (bytesRead > 0) { state.sb.Append(Encoding.ASCII.GetString(state.buffer, 0, bytesRead)); client.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(ReceiveCallback), state); } if (!string.IsNullOrEmpty(state.sb.ToString())) { ConnectionStrategy.ReceiveMessage(state.sb.ToString()); } }
public void ReceiveMessagePubsub(string result) { Arbiter.LocalRunLaunch = false; ConnectionStrategy.ReceiveMessage(result); }
//Incoming call from browser (Sent by "SendMessage()" Unity javascript method that points to this class and method). public void LaunchTest(string test) { ConnectionStrategy.ReceiveMessage(string.Format("{{ \"automation_command\": \"rt *{0}\" }}", test)); }
static string RunTests(List <string> args) { Arbiter.LocalRunLaunch = true; ConnectionStrategy.ReceiveMessage(string.Format("{{ \"automation_command\": \"rt {0}\" }}", string.Join(string.Empty, args.ToArray()))); return("Test run command received. Please view the Nexus AutoConsole for further logging updates."); }
static string LaunchTrilleonFrameworkValidation(List <string> args) { Arbiter.LocalRunLaunch = true; ConnectionStrategy.ReceiveMessage("[{\"automation_command\": \"rt Trilleon/Validation\"}]"); return("Validation Started; Request logs to view ongoing results."); }