[zeromq-dev] How to detect if a remote socket has closed
Matt Weinstein
matt_weinstein at yahoo.com
Tue Aug 17 15:23:02 CEST 2010
You should consider wiring together your own DEVICE. I've got a
reactor upcall pattern (still a work-in-progress) at github.
The DEVICE is ideal for this because you can muck with the streams on
a single thread, and let ØMQ be the high speed queueing platform,
provide the send/recv locks, etc.
You can manage all the discovery via pub sub within a DEVICE, then
channel your communications to multiple endpoints.
On Aug 17, 2010, at 9:07 AM, <David.Briant at ubs.com> <David.Briant at ubs.com
> wrote:
> chrs. Newbie Q. A DEVICE is a ZMQ concept right? presumable
> implemented in C/C++?
>
> I implemented a peer-to-peer async messaging system (in VB6 of all
> things) that did all this 10+ years ago for a financial institution
> – they still use it. It had basic messaging, resource discovery, pub-
> sub, reliable (guaranteed) messaging, failover etc.
>
> I’m used to doing all the application stuff (heartbeats, resource
> discovery) over the one channel rather than needing to have several
> sockets to get the overall functionality.
>
> I thought about re-implementing it but came across zmq that I am
> still hoping will provide all the bits and bobs.
>
> From: zeromq-dev-bounces at lists.zeromq.org [mailto:zeromq-dev-bounces at lists.zeromq.org
> ] On Behalf Of Matt Weinstein
> Sent: Tue 17-Aug-2010 13:15
> To: 0MQ development list
> Subject: Re: [zeromq-dev] How to detect if a remote socket has closed
>
> You're stuck with TCP timeout AFAIK.
>
> You're probably better if building a heartbeat mechanism using a
> specialized DEVICE. This will give you failover as well.
>
> It's a "little" wonky to implement until you can move sockets
> between threads (the connect() call can have significant latency, so
> it needs to run a separate thread).
>
> On Aug 16, 2010, at 1:26 PM, <David.Briant at ubs.com> <David.Briant at ubs.com
> > wrote:
>
>
> I’m coding in python and I can’t figure out how to detect if a
> remote process has closed or terminated (I exited my python server
> and judging from the cpu usage zmq is trying to re-establish
> connection but I just can’t see how to determine that in the API).
> Is it possible? and if so how do I do it.
>
> Thx
>
> David
>
> PS I’m sure this must have been asked before but I’ve spent the last
> hour looking through the archives and I can’t find it so apologies
> in advance if I’m asking an “obvious” question.
>
> Visit our website at http://www.ubs.com
>
> This message contains confidential information and is intended only
> for the individual named. If you are not the named addressee you
> should not disseminate, distribute or copy this e-mail. Please
> notify the sender immediately by e-mail if you have received this
> e-mail by mistake and delete this e-mail from your system.
>
> E-mails are not encrypted and cannot be guaranteed to be secure or
> error-free as information could be intercepted, corrupted, lost,
> destroyed, arrive late or incomplete, or contain viruses. The sender
> therefore does not accept liability for any errors or omissions in the
> contents of this message which arise as a result of e-mail
> transmission.
> If verification is required please request a hard-copy version. This
> message is provided for informational purposes and should not be
> construed as a solicitation or offer to buy or sell any securities
> or related financial instruments.
>
> UBS Limited is a company registered in England & Wales under company
> number 2035362, whose registered office is at 1 Finsbury Avenue,
> London, EC2M 2PP, United Kingdom.
>
> UBS AG (London Branch) is registered as a branch of a foreign company
> under number BR004507, whose registered office is at
> 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom.
>
> UBS Clearing and Execution Services Limited is a company registered
> in England & Wales under company number 03123037, whose registered
> office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom.
>
> UBS reserves the right to retain all messages. Messages are protected
> and accessed only in legally justified
> cases._______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
> Visit our website at http://www.ubs.com
>
> This message contains confidential information and is intended only
> for the individual named. If you are not the named addressee you
> should not disseminate, distribute or copy this e-mail. Please
> notify the sender immediately by e-mail if you have received this
> e-mail by mistake and delete this e-mail from your system.
>
> E-mails are not encrypted and cannot be guaranteed to be secure or
> error-free as information could be intercepted, corrupted, lost,
> destroyed, arrive late or incomplete, or contain viruses. The sender
> therefore does not accept liability for any errors or omissions in the
> contents of this message which arise as a result of e-mail
> transmission.
> If verification is required please request a hard-copy version. This
> message is provided for informational purposes and should not be
> construed as a solicitation or offer to buy or sell any securities
> or related financial instruments.
>
> UBS Limited is a company registered in England & Wales under company
> number 2035362, whose registered office is at 1 Finsbury Avenue,
> London, EC2M 2PP, United Kingdom.
>
> UBS AG (London Branch) is registered as a branch of a foreign company
> under number BR004507, whose registered office is at
> 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom.
>
> UBS Clearing and Execution Services Limited is a company registered
> in England & Wales under company number 03123037, whose registered
> office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom.
>
> UBS reserves the right to retain all messages. Messages are protected
> and accessed only in legally justified
> cases._______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100817/f01d6532/attachment.htm>
More information about the zeromq-dev
mailing list