Example #1
0
    public static void Main()
    {
        HttpTransportBindingElement el =
            new HttpTransportBindingElement();
        BindingContext bc = new BindingContext(
            new CustomBinding(),
            new BindingParameterCollection(),
            new Uri("http://localhost:37564"),
            String.Empty, ListenUriMode.Explicit);
        IChannelListener <IReplyChannel> listener =
            el.BuildChannelListener <IReplyChannel> (bc);

        listener.Open();

        IReplyChannel reply = listener.AcceptChannel();

        reply.Open();

        if (!reply.WaitForRequest(TimeSpan.FromSeconds(10)))
        {
            Console.WriteLine("No request reached here.");
            return;
        }
        Console.WriteLine("Receiving request ...");
        RequestContext ctx = reply.ReceiveRequest();

        if (ctx == null)
        {
            return;
        }
        Console.WriteLine("Starting reply ...");
        ctx.Reply(Message.CreateMessage(MessageVersion.Default, "Ack"));
    }
	static void RunListener (IReplyChannel reply)
	{
		if (!reply.WaitForRequest (TimeSpan.FromSeconds (10))) {
			Console.WriteLine ("No request reached here.");
			return;
		}
		Console.WriteLine ("Receiving request ...");
		RequestContext ctx = reply.ReceiveRequest ();
		if (ctx == null)
			return;
		Console.WriteLine ("Starting reply ...");
		ctx.Reply (Message.CreateMessage (MessageVersion.Default, "Ack"));
	}
Example #3
0
    static void RunListener(IReplyChannel reply)
    {
        if (!reply.WaitForRequest(TimeSpan.FromSeconds(10)))
        {
            Console.WriteLine("No request reached here.");
            return;
        }
        Console.WriteLine("Receiving request ...");
        RequestContext ctx = reply.ReceiveRequest();

        if (ctx == null)
        {
            return;
        }
        Console.WriteLine("Starting reply ...");
        ctx.Reply(Message.CreateMessage(MessageVersion.Default, "Ack"));
    }
Example #4
0
        string LowLevelHttpConnection_SetupService()
        {
            IReplyChannel reply = listener.AcceptChannel();

            reply.Open();
            if (!reply.WaitForRequest(TimeSpan.FromSeconds(10)))
            {
                return("No request reached here.");
            }

            svcret = "Receiving request ...";
            RequestContext ctx = reply.ReceiveRequest();

            if (ctx == null)
            {
                return("No request context returned.");
            }

            svcret = "Starting reply ...";
            ctx.Reply(Message.CreateMessage(MessageVersion.Default, "Ack"));
            return(null);            // OK
        }
 public bool WaitForRequest(TimeSpan timeout)
 {
     return(innerReplyChannel.WaitForRequest(timeout));
 }
Example #6
0
 public override bool WaitForRequest(TimeSpan timeout)
 {
     return(inner.WaitForRequest(timeout));
 }
 public virtual bool WaitForRequest(TimeSpan timeout)
 {
     return(inner.WaitForRequest(timeout));
 }
Example #8
0
 public bool WaitForRequest(TimeSpan timeout)
 => _innerChannel.WaitForRequest(timeout);