| using System.Collections.Generic; |
| //Uncomment to enable debug |
| // Console.WriteLine (msg); |
| public TZmqServer (TProcessor processor, Context ctx, String endpoint, SocketType sockType) |
| new TSimpleServer (processor,null); |
| _socket = ctx.Socket (sockType); |
| debug ("Server_ServeOne"); |
| Byte[] msg = _socket.Recv (); |
| MemoryStream istream = new MemoryStream (msg); |
| MemoryStream ostream = new MemoryStream (); |
| TProtocol tProtocol = new TBinaryProtocol (new TStreamTransport (istream, ostream)); |
| _processor.Process (tProtocol, tProtocol); |
| if (ostream.Length != 0) { |
| byte[] newBuf = new byte[ostream.Length]; |
| Array.Copy (ostream.GetBuffer (), newBuf, ostream.Length); |
| debug (string.Format ("Server_ServeOne sending {0}b", ostream.Length)); |