def send(self, obj):
        """Prepend a 4-byte length to the string"""
        assert isinstance(obj, ProtocolBase)
        string = pickle.dumps(obj)
        length = len(string)
        self.sock.sendall(struct.pack("<I", length) + string)
def send ( self , obj ) : assert isinstance ( obj , ProtocolBase ) string = pickle . dumps ( obj ) length = len ( string ) self . sock . sendall ( struct . pack ( "<I" , length ) + string )
Prepend a 4-byte length to the string