Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #61952
| References | (3 earlier) <mailman.4027.1386883640.18130.python-list@python.org> <l8fbam$6q2$1@reader1.panix.com> <mailman.4131.1387070671.18130.python-list@python.org> <l8kh1r$bj8$1@reader1.panix.com> <roy-A0D956.10511915122013@news.panix.com> |
|---|---|
| Date | 2013-12-16 03:04 +1100 |
| Subject | Re: [newbie] trying socket as a replacement for nc |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4143.1387123508.18130.python-list@python.org> (permalink) |
On Mon, Dec 16, 2013 at 2:51 AM, Roy Smith <roy@panix.com> wrote: > In article <l8kh1r$bj8$1@reader1.panix.com>, > Grant Edwards <invalid@invalid.invalid> wrote: > >> UDP is a a _datagram_ service. Either all the bytes in a write() >> should get sent or none of them. Sending a paritial datagram is _not_ >> a valid option. > > I would agree with the above if you said send() instead of write(). > Python socket objects don't have write() methods, file objects do. You > can wrap a file around a socket with socket.makefile(), but I'm not sure > I would expect the UDP record boundary semantics to be honored once you > did that. The underlying C API allows you, on Unix-like systems at least, to use the standard write() function to send UDP packets (as long as you first connect() - otherwise you need sendto() to specify a destination). I don't usually use that method, but I would expect that one call to write() becomes one UDP packet. How that works with socket.makefile() in Python I have no idea. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[newbie] trying socket as a replacement for nc Jean Dubois <jeandubois314@gmail.com> - 2013-12-11 15:08 -0800
Re: [newbie] trying socket as a replacement for nc Dan Stromberg <drsalists@gmail.com> - 2013-12-11 15:20 -0800
Re: [newbie] trying socket as a replacement for nc Jean Dubois <jeandubois314@gmail.com> - 2013-12-12 00:28 -0800
Re: [newbie] trying socket as a replacement for nc Dan Stromberg <drsalists@gmail.com> - 2013-12-12 13:23 -0800
Re: [newbie] trying socket as a replacement for nc Jean Dubois <jeandubois314@gmail.com> - 2013-12-12 19:23 -0800
Re: [newbie] trying socket as a replacement for nc Dan Stromberg <drsalists@gmail.com> - 2013-12-12 19:32 -0800
Re: [newbie] trying socket as a replacement for nc Jean Dubois <jeandubois314@gmail.com> - 2013-12-13 03:03 -0800
Re: [newbie] trying socket as a replacement for nc Jean Dubois <jeandubois314@gmail.com> - 2013-12-13 03:56 -0800
Re: [newbie] trying socket as a replacement for nc Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-13 08:35 +0000
Re: [newbie] trying socket as a replacement for nc Jean Dubois <jeandubois314@gmail.com> - 2013-12-13 04:20 -0800
Re: [newbie] trying socket as a replacement for nc rusi <rustompmody@gmail.com> - 2013-12-13 09:04 -0800
Re: [newbie] trying socket as a replacement for nc rusi <rustompmody@gmail.com> - 2013-12-13 09:09 -0800
Re: [newbie] trying socket as a replacement for nc Jean Dubois <jeandubois314@gmail.com> - 2013-12-14 05:11 -0800
Re: [newbie] trying socket as a replacement for nc Jean Dubois <jeandubois314@gmail.com> - 2013-12-14 05:14 -0800
Re: [newbie] trying socket as a replacement for nc Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-14 13:29 +0000
Re: [newbie] trying socket as a replacement for nc Jean Dubois <jeandubois314@gmail.com> - 2013-12-16 01:40 -0800
Re: [newbie] trying socket as a replacement for nc Ervin Hegedüs <airween@gmail.com> - 2013-12-16 11:04 +0100
Re: [newbie] trying socket as a replacement for nc Grant Edwards <invalid@invalid.invalid> - 2013-12-12 14:16 +0000
Re: [newbie] trying socket as a replacement for nc Chris Angelico <rosuav@gmail.com> - 2013-12-13 01:23 +1100
Re: [newbie] trying socket as a replacement for nc Dan Stromberg <drsalists@gmail.com> - 2013-12-12 13:27 -0800
Re: [newbie] trying socket as a replacement for nc Grant Edwards <invalid@invalid.invalid> - 2013-12-13 16:06 +0000
Re: [newbie] trying socket as a replacement for nc Dan Stromberg <drsalists@gmail.com> - 2013-12-14 17:24 -0800
Re: [newbie] trying socket as a replacement for nc Grant Edwards <invalid@invalid.invalid> - 2013-12-15 15:15 +0000
Re: [newbie] trying socket as a replacement for nc Roy Smith <roy@panix.com> - 2013-12-15 10:51 -0500
Re: [newbie] trying socket as a replacement for nc Chris Angelico <rosuav@gmail.com> - 2013-12-16 03:04 +1100
Re: [newbie] trying socket as a replacement for nc Roy Smith <roy@panix.com> - 2013-12-15 12:44 -0500
Re: [newbie] trying socket as a replacement for nc Grant Edwards <invalid@invalid.invalid> - 2013-12-15 22:42 +0000
Re: [newbie] trying socket as a replacement for nc Chris Angelico <rosuav@gmail.com> - 2013-12-16 09:48 +1100
Re: [newbie] trying socket as a replacement for nc Chris Angelico <rosuav@gmail.com> - 2013-12-13 08:58 +1100
Re: [newbie] trying socket as a replacement for nc Grant Edwards <invalid@invalid.invalid> - 2013-12-13 16:10 +0000
Re: [newbie] trying socket as a replacement for nc Chris Angelico <rosuav@gmail.com> - 2013-12-14 03:19 +1100
Re: [newbie] trying socket as a replacement for nc Grant Edwards <invalid@invalid.invalid> - 2013-12-13 16:57 +0000
Re: [newbie] trying socket as a replacement for nc Chris Angelico <rosuav@gmail.com> - 2013-12-14 04:05 +1100
Re: [newbie] trying socket as a replacement for nc 88888 Dihedral <dihedral88888@gmail.com> - 2013-12-16 04:38 -0800
Re: [newbie] trying socket as a replacement for nc Chris Angelico <rosuav@gmail.com> - 2013-12-16 23:59 +1100
Re: [newbie] trying socket as a replacement for nc Roy Smith <roy@panix.com> - 2013-12-16 09:03 -0500
Re: [newbie] trying socket as a replacement for nc 88888 Dihedral <dihedral88888@gmail.com> - 2013-12-18 23:20 -0800
Re: [newbie] trying socket as a replacement for nc Dave Angel <davea@davea.name> - 2013-12-12 19:52 -0500
Re: [newbie] trying socket as a replacement for nc Conor Hughes <conorh@conorh.net> - 2013-12-11 15:38 -0800
Re: [newbie] trying socket as a replacement for nc Jean Dubois <jeandubois314@gmail.com> - 2013-12-12 00:08 -0800
Re: [newbie] trying socket as a replacement for nc Chris Angelico <rosuav@gmail.com> - 2013-12-12 19:21 +1100
Re: [newbie] trying socket as a replacement for nc Jean Dubois <jeandubois314@gmail.com> - 2013-12-12 01:21 -0800
Re: [newbie] trying socket as a replacement for nc Alister <alister.ware@ntlworld.com> - 2013-12-12 14:05 +0000
Re: [newbie] trying socket as a replacement for nc Alister <alister.ware@ntlworld.com> - 2013-12-12 14:05 +0000
Re: [newbie] trying socket as a replacement for nc Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-12 14:34 +0000
Re: [newbie] trying socket as a replacement for nc Christian Gollwitzer <auriocus@gmx.de> - 2013-12-13 00:43 +0100
csiph-web