• Distributed under the GPL, v2, or any later version, at your option
    bufsock.py is a python module that makes it a little bit easier to work with sockets, and may also make your I/O faster if you're reading and/or writing lots of tiny packets.

    Also, you may find that it makes your network applications more reliable, as the network is allowed to split apart your packets into multiple smaller packets, or aggregate two or more packets into one larger packet, if it decides it needs to do so for reliability or performance. So you might do a s.recv expecting to get one line of input, but the network decided to batch together two remote s.send's into one s.recv, for example. But the network usually, but not always, will batch up your packets the way you'd expect - so this can be a difficult problem to track down.

    You can download it here

    It supports the following methods:

    Usage:

    bufsock.py is released under the terms of the GPLv2.

    Related work






    Back to Dan's tech tidbits