Scatter/gather on sockets?

2006-04-01 Thread Roy Smith
I've got a bunch of strings in a list: vector = [] vector.append (foo) vector.append (bar) vector.append (baz) I want to send all of them out a socket in a single send() call, so they end up in a single packet (assuming the MTU is large enough). I can do: mySocket.send (.join (vector)) but

Re: Scatter/gather on sockets?

2006-04-01 Thread Peter Hansen
Roy Smith wrote: I've got a bunch of strings in a list: vector = [] vector.append (foo) vector.append (bar) vector.append (baz) I want to send all of them out a socket in a single send() call, so they end up in a single packet (assuming the MTU is large enough). I can do:

Re: Scatter/gather on sockets?

2006-04-01 Thread Anthony Greene
On Sat, 01 Apr 2006 14:56:02 -0500, Roy Smith wrote: I've got a bunch of strings in a list: vector = [] vector.append (foo) vector.append (bar) vector.append (baz) I want to send all of them out a socket in a single send() call, so they end up in a single packet (assuming the MTU is

Re: Scatter/gather on sockets?

2006-04-01 Thread Roy Smith
Peter Hansen [EMAIL PROTECTED] wrote: B. Don't bother trying, because even if the MTU is large enough there is absolutely no guarantee that the packet will stay intact all the way through the network anyway (even if you use sendall() instead of send()). This is true, but I'm generating the

Re: Scatter/gather on sockets?

2006-04-01 Thread Roy Smith
In article [EMAIL PROTECTED], Anthony Greene [EMAIL PROTECTED] wrote: On Sat, 01 Apr 2006 14:56:02 -0500, Roy Smith wrote: I've got a bunch of strings in a list: vector = [] vector.append (foo) vector.append (bar) vector.append (baz) I want to send all of them out a socket

Re: Scatter/gather on sockets?

2006-04-01 Thread Paul Rubin
Roy Smith [EMAIL PROTECTED] writes: This is true, but I'm generating the message being sent in very small chunks (often as small as 4 bytes at a time), and typically need to flush a packet out onto the network after a few dozen bytes. Maybe at most a few hundred. I don't know of any

Re: Scatter/gather on sockets?

2006-04-01 Thread Jean-Paul Calderone
On 1 Apr 2006 14:56:02 -0500, Roy Smith [EMAIL PROTECTED] wrote: I've got a bunch of strings in a list: vector = [] vector.append (foo) vector.append (bar) vector.append (baz) I want to send all of them out a socket in a single send() call, so they end up in a single packet (assuming the MTU is