Ejemplo n.º 1
0
            public void RouterMessage(ZMessage reply)
            {
                // This method processes one message from a connected
                // server:

                // Frame 0 is server that replied
                string endpoint = reply.PopString();
                Server server   = this.Servers.Single(s => s.Endpoint == endpoint);

                if (!server.Alive)
                {
                    this.Actives.Add(server);
                    server.Refresh(true);
                }

                // Frame 1 may be sequence number for reply
                int sequence = reply.PopInt32();

                if (sequence == this.sequence)
                {
                    reply.Prepend(new ZFrame("OK"));

                    this.Pipe.Send(reply);

                    this.Request.Dispose();
                    this.Request = null;
                }
            }
Ejemplo n.º 2
0
			public void RouterMessage(ZMessage reply)
			{
				// This method processes one message from a connected
				// server:

				// Frame 0 is server that replied
				string endpoint = reply.PopString();
				Server server = this.Servers.Single(s => s.Endpoint == endpoint);
				if (!server.Alive)
				{
					this.Actives.Add(server);
					server.Refresh(true);
				}

				// Frame 1 may be sequence number for reply
				int sequence = reply.PopInt32();
				if (sequence == this.sequence)
				{
					reply.Prepend(new ZFrame("OK"));

					this.Pipe.Send(reply);

					this.Request.Dispose();
					this.Request = null;
				}
			}