Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'say,': 0.05; 'context': 0.07; 'prototyping': 0.07; 'suggestions,': 0.07; 'pointers': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:using': 0.09; 'python': 0.11; '*any*': 0.16; '...,': 0.16; 'attempted': 0.16; 'available;': 0.16; 'elsewhere.': 0.16; 'expecting': 0.16; 'rabbitmq': 0.16; 'received)': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'rings': 0.16; 'seconds,': 0.16; 'slave': 0.16; 'subject:send': 0.16; 'tcp': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'machine': 0.22; 'header:User-Agent:1': 0.23; 'of.': 0.24; 'prototype': 0.24; 'header:X-Complaints-To:1': 0.27; 'point': 0.28; 'wondering': 0.29; 'changed.': 0.31; 'maintains': 0.31; 'probably': 0.32; 'maintaining': 0.32; 'device': 0.34; 'trouble': 0.34; 'connection': 0.35; 'but': 0.35; 'add': 0.35; 'there': 0.35; 'data,': 0.36; 'done': 0.36; 'thanks': 0.36; 'similar': 0.36; 'should': 0.36; 'half': 0.37; 'list': 0.37; 'server': 0.38; 'problems': 0.38; 'connections': 0.38; 'needed': 0.38; 'to:addr :python-list': 0.38; 'previous': 0.38; 'little': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'devices': 0.61; 'forum': 0.61; 'new': 0.61; 'such': 0.63; 'our': 0.64; 'face': 0.64; 'talking': 0.65; 'close': 0.67; 'messaging': 0.68; 'periodically': 0.68; 'acts': 0.74; 'connection.': 0.74; 'long- term': 0.74; 'upper': 0.74; 'power': 0.76; 'bells': 0.84; 'cable': 0.84; 'here...': 0.84; 'hour,': 0.84; 'dozen': 0.91; 'connection,': 0.95 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Peter Otten <__peter__@web.de> Subject: Re: OTish: using short-term TCP connections to send to multiple slaves Date: Mon, 17 Nov 2014 09:16:59 +0100 Organization: None References: Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: p57bd8ca6.dip0.t-ipconnect.de User-Agent: KNode/4.13.3 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 45 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416212236 news.xs4all.nl 2867 [2001:888:2000:d::a6]:57754 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:80965 jkn wrote: > Hi all > This is a little bit OT for this newsgroup, but I intend to use python > for prototyping at least, and I know there are a lot of knowledgeable > people using Python in a Network context here... > > I have a use case of a single 'master' machine which will need to > periodically 'push' data to a variety of 'slave' devices on a small local > subnet, over Ethernet. We are talking perhaps a dozen devices in all with > comms occurring perhaps once very few seconds, to much less often - once > per half an hour, or less. There is probably an upper bound of 64KB or so > of data that is likely to be sent on each occasion. > > Previous similar systems have attempted to do this by maintaining multiple > long-term TCP connections from the master to all the slave devices. The > Master is the server and the slaves periodically check the master to see > what has changed. Although this ... works ..., we have had trouble > maintaining the connection, for reasons ... I am not yet fully aware of. > > We are now considering an alternative approach where the master maintains > a list of slave devices and acts as a client. Each device is a server from > the point of view of data transfer. We would then use a short-lived TCP > connection when data is available; the Master would connect to each slave > which needed the data, send it, and close the connection. > > I should also add that we desire our system to be 'robust' in the face of > situations such as cable unplugging, device power cycles, etc. > > Although this might get round some of our current problems, I can see that > we might end up with new problems to deal with. I am wondering if this > scenario rings bells with anyone, and seeking pointers to what has been > done elsewhere. As I say, I am expecting to prototype it in Python so any > specifics also welcome! > > (suggestions as to a better forum to ask for previous experience also > gratefully received) > > Thanks al lot for any thoughts/suggestions You said *any* suggestions, so: I know nothing about them, but would a messaging infrastructure like RabbitMQ or ZeroMQ be useful?