Пример #1
0
 public void TestBodylessMessage()
 {
     var s = new MemoryStream(Encoding.UTF8.GetBytes("6\nAPP_UP"));
     var cmd = new CommandConnection(null, s);
     var msg = cmd.GetCommand();
     Trace.WriteLine(msg);
     Assert.AreEqual(msg, "APP_UP");
 }
Пример #2
0
 public void TestBodaciousMessage()
 {
     var input = "30\nMSG_BROADCAST {\"key\": \"value\"}";
     var s = new MemoryStream(Encoding.UTF8.GetBytes(input));
     var cmd = new CommandConnection(null, s);
     var msg = cmd.GetCommand();
     Trace.WriteLine(msg);
     Trace.WriteLine(input.Substring(3));
     Assert.AreEqual(msg, input.Substring(3));
 }
Пример #3
0
 /// <summary>
 /// Put a newly connected app in its own thread in the app thread pool
 /// </summary>
 /// <param name="connection"></param>
 private void HandleNewClientConnection(CommandConnection connection)
 {
     var instance = new AppInstance(connection, this);
     instance.Listen();
 }