News for hackers. Stuff that matters.
Re:In-memory key-value store in C, Go and Python by irahul on Wednesday March 21, 2012 @06:09AM (#3733730)
sock.sendall() isn't the same as `sock.send(); sock.flush()`

sendall will look something like:

    def sendall(sock, msg):
        totalsent = 0
        MSGLEN = len(msg)
        while totalsent < MSGLEN:
            sent = sock.send(msg[totalsent:])
            if sent == 0:
                raise RuntimeError("socket connection broken")
            totalsent = totalsent + sent
Re:In-memory key-value store in C, Go and Python by codeape on Wednesday March 21, 2012 @06:27AM (#3733764)
I don't use socket.send/flush. I use sockfile.write/flush.