Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #80887
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!ra.nrl.navy.mil!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail |
|---|---|
| From | Grant Edwards <invalid@invalid.invalid> |
| Newsgroups | comp.lang.python |
| Subject | Re: OTish: using short-term TCP connections to send to multiple slaves |
| Date | Sun, 16 Nov 2014 16:53:52 +0000 (UTC) |
| Organization | PANIX Public Access Internet and UNIX, NYC |
| Lines | 45 |
| Message-ID | <m4akr0$r03$2@reader1.panix.com> (permalink) |
| References | <SMCdnZ700MHHD_XJnZ2dnUVZ8iSdnZ2d@brightview.co.uk> <87oas7ntvv.fsf@dpt-info.u-strasbg.fr> <mailman.15887.1416150791.18130.python-list@python.org> |
| NNTP-Posting-Host | c-24-118-110-103.hsd1.mn.comcast.net |
| X-Trace | reader1.panix.com 1416156832 27651 24.118.110.103 (16 Nov 2014 16:53:52 GMT) |
| X-Complaints-To | abuse@panix.com |
| NNTP-Posting-Date | Sun, 16 Nov 2014 16:53:52 +0000 (UTC) |
| User-Agent | slrn/1.0.1 (Linux) |
| Xref | csiph.com comp.lang.python:80887 |
Show key headers only | View raw
On 2014-11-16, Chris Angelico <rosuav@gmail.com> wrote: > >> OK, no big requirements, but 64K is still way too much to consider UDP. > > I wouldn't say "way too much"; the packet limit for UDP is actually > 64KB (minus a few bytes of headers). But UDP for anything more than > your network's MTU is inefficient, plus you'd need to roll your own > acknowledgement system so you know when the client got the data, at > which point you're basically recreating TCP. > > That said, though: UDP would be a good option, if and only if you can > comply with those two restrictions - sender doesn't care if the odd > packet doesn't get through, and no packet is allowed to exceed 64KB, > with typical packet sizes wanting to be more like 1KB. (DNS servers > usually switch you to TCP if you go above 512 bytes of response, but > that's because DNS responses are usually tiny.) It'd be pretty easy to > knock together a simple UDP system - you have the clients listen on > some particular port, and you could even make use of IP broadcast to > send to everyone all at once, since this is a single LAN. If, as the OP seemed to state, this is strictly within a single network segement (no firewalls or routers involved), then UDP multicast might be worth considering. It's not reliable like TCP, but it does make everything very simple: just decide how many different logical data streams you are going to have, and allocate a multicast address for each one. Have the server multicast new data whenever it becomes available, and the slaves all register for and and listen to for whichever data streams they care about. Note that the "register for" (or join, or whatever it's called) isn't something the server knows about, that's purely done by the slave app to inform the slave's network stack and any intervening routers what multicast streams the slave app wants to see. In _theory_, if betwixt the server and client the routers and firewalls are properly configured, multicast should still work. But, the smart money will be giving long odds that they aren't, and it won't. One possible advantage of UDP is that is packet oriented, so if your data isn't message oriented rather than an undifferentiated byte stream, UDP saves you the effort of having to packetize and unpacketize the data as you have to via TCP. -- Grant
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
OTish: using short-term TCP connections to send to multiple slaves jkn <jkn_gg@nicorp.f9.co.uk> - 2014-11-16 12:02 +0000
Re: OTish: using short-term TCP connections to send to multiple slaves Chris Angelico <rosuav@gmail.com> - 2014-11-16 23:36 +1100
Re: OTish: using short-term TCP connections to send to multiple slaves Marko Rauhamaa <marko@pacujo.net> - 2014-11-16 14:44 +0200
Re: OTish: using short-term TCP connections to send to multiple slaves Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2014-11-16 14:43 +0100
Re: OTish: using short-term TCP connections to send to multiple slaves Chris Angelico <rosuav@gmail.com> - 2014-11-17 02:13 +1100
Re: OTish: using short-term TCP connections to send to multiple slaves Grant Edwards <invalid@invalid.invalid> - 2014-11-16 16:53 +0000
Re: OTish: using short-term TCP connections to send to multiple slaves Roy Smith <roy@panix.com> - 2014-11-16 12:21 -0500
Re: OTish: using short-term TCP connections to send to multiple slaves Grant Edwards <invalid@invalid.invalid> - 2014-11-16 17:35 +0000
Re: OTish: using short-term TCP connections to send to multiple slaves Chris Angelico <rosuav@gmail.com> - 2014-11-17 08:56 +1100
Re: OTish: using short-term TCP connections to send to multiple slaves alister <alister.nospam.ware@ntlworld.com> - 2014-11-17 10:46 +0000
Re: OTish: using short-term TCP connections to send to multiple slaves jkn <jkn_gg@nicorp.f9.co.uk> - 2014-11-16 21:45 +0000
Re: OTish: using short-term TCP connections to send to multiple slaves Grant Edwards <invalid@invalid.invalid> - 2014-11-17 16:56 +0000
Re: OTish: using short-term TCP connections to send to multiple slaves Grant Edwards <invalid@invalid.invalid> - 2014-11-16 16:42 +0000
Re: OTish: using short-term TCP connections to send to multiple slaves Peter Otten <__peter__@web.de> - 2014-11-17 09:16 +0100
csiph-web