public static stop ( Wombat.MamaBridge bridgeImpl ) : void | ||
bridgeImpl | Wombat.MamaBridge | /// The bridge specific structure. /// |
return | void |
public override void onIo(MamaIo io, mamaIoType ioType) { Socket sock = example_.client; byte [] buffer = new byte[1024]; int len = sock.Receive(buffer, 1023, SocketFlags.None); buffer[len] = (byte)'\0'; string text = Encoding.ASCII.GetString(buffer, 0, len); if (!example_.quiet) { Console.WriteLine("READ: {0}", text); } // should test for "quit", but Windows' telnet client won't send it // no matter if "set mode stream" was used and would send only partial // substrings, such as "q", then "uit", "qu", then "it", etc. if (text.StartsWith("q")) { Console.WriteLine("QUITING"); Mama.stop(MamaIoCS.bridge); return; } sock.Send(buffer, len, SocketFlags.None); }
public void onTimer(MamaTimer mamaTimer, object closure) { Publish(null); if (messageCount_ > 0 && --messageCount_ == 0) { Mama.stop(bridge); return; } }
// Timer Callbacks public void onTimer(MamaTimer mamaTimer, object closure) { Publish(null); if (messageCount > 0 && --messageCount <= 0) { publisher.destroy(); System.Threading.Thread.Sleep(1000); // let queued events process Mama.stop(bridge); } }