In article <[email protected]>, Chris Angelico <[email protected]> wrote:
> On Mon, Dec 16, 2013 at 2:51 AM, Roy Smith <[email protected]> wrote: > > In article <[email protected]>, > > Grant Edwards <[email protected]> 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. At the Unix system call level, yes. But, given that this is a Python newsgroup, I made the assumption we were talking about the Python API level. Silly me :-) -- https://mail.python.org/mailman/listinfo/python-list
