def send(self, msg):
        messagestr = pickle.dumps(msg)
        message = struct.pack("I", len(messagestr)) + messagestr
        try:
            while len(message) > 0:
                try:
                    bytesent = self.thesocket.send(message)
                    message = message[bytesent:]
                except IOError, e:
                    if isinstance(e.args, tuple):
                        if e[0] == errno.EAGAIN:
                            continue
                        else:
                            raise e
                except AttributeError, e:
                    raise e
            return True
        except socket.error, e:
            if isinstance(e.args, tuple):
                if e[0] == errno.EPIPE:
                    print "Remote disconnect"
                    return False
        except IOError, e:
            print "Send Error: ", e
        except __HOLE__, e:
            print "Socket deleted."
        return False
dataset/ETHPy150Open denizalti/concoord/concoord/object/pinger.py/Pinger.send