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 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 that involves creating an intermediate string. Is there a more > > efficient way, that doesn't involve that extra data copy? > > Is sendall() what you're looking for? No. Sendall() is actually what I'm using now. It handles the other side of the issue; issuing repeated send() calls if the system fragments your buffer. I'm trying to aggregate lots of small buffers into one large one. -- http://mail.python.org/mailman/listinfo/python-list