Yes, this is C#. The poll event is going to tell you when data is available, that's when you're going to do your recv.
-- Paul Betts <[email protected]> On Sat, Nov 5, 2011 at 4:54 PM, <[email protected]> wrote: > Hi Paul, > Thanks for this suggestion. In the piece of code you just outline, I > noticed there's no recv() method been called, is the message still going to > come in? Also I just wanted to confirm that this is a C# code because that's > the only important thing to me right now. Also I'm not building a console > application so there's no need to the indefinite loop you have there. In a > nutshell I'll like to seek ur help with the piece of code that'll use this > polling system to pull in data once (no loop) and would include the support > for the timeout value. Thanks > Sent from my BlackBerryŽ wireless handheld from Glo Mobile. > > -----Original Message----- > From: Paul Betts <[email protected]> > Date: Sat, 5 Nov 2011 16:28:20 > To: ZeroMQ development list<[email protected]> > Cc: lanre lawal<[email protected]> > Subject: Re: [zeromq-dev] clr-zmq FREEZING!!! > > This exists in clrzmq as well, here's the gist of it: > > Context ctx; > Socket socketForCtx; > PollItems[] pollItems; > > pollItems[0] = socketForCtx.CreatePollItem(IOMultiPlex.POLLIN | > IOMultiPlex.POLLOUT); > pollItems[0].PollInHandler += (s, r) => Console.WriteLine("In!"); > pollItems[0].PollInHandler += (s, r) => Console.WriteLine("Out!"); > > while(1) { > ctx.Poll(pollItems, 250/*ms*/); > } > > On Sat, Nov 5, 2011 at 12:29 PM, Ian Barber <[email protected]> wrote: >> On Sat, Nov 5, 2011 at 11:17 AM, lanre lawal <[email protected]> wrote: >> So I was wondering is there a way not to set the NOBLOCK >>> option and then set a timeout (milliseconds) for the request so that it >>> sticks around for data just for a specified period of time. That way I don't >>> need to set the NOBLOCK option and I can be guaranteed that the server would >>> be freed up after a particular amount of seconds. >> >> Yep, take a look at zmq_poll - no idea what that is in the CLR >> bindings, but they'll let you wait for a message for a certain >> timeout. Might be worth a look at the guide as well for a good >> introduction: http://zguide.zeromq.org/page:all >> >> Ian >> _______________________________________________ >> zeromq-dev mailing list >> [email protected] >> http://lists.zeromq.org/mailman/listinfo/zeromq-dev >> > _______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
