priv/python3/erlport/erlproto.py
def write(self, message):
        """Write outgoing message."""
        data = encode(message, compressed=self.compressed)
        length = len(data)
        data = self.__pack(length) + data
        with self.__write_lock:
            while data:
                try:
                    n = os.write(self.out_d, data)
                except OSError as why:
                    if why.errno in (errno.EPIPE, errno.EINVAL):
                        raise EOFError()
                    raise
                if not n:
                    raise EOFError()
                data = data[n:]
        return length + self.packet
def write(self, message):
        """Write outgoing message."""
        data = encode(message, compressed=self.compressed)
        length = len(data)
        data = self.__pack(length) + data
        with self.__write_lock:
            while data:
                try:
                    n = os.write(self.out_d, data)
                except OSError as why:
                    if why.errno in (errno.EPIPE, errno.EINVAL):
                        raise EOFError()
                    raise
                if not n:
                    raise EOFError()
                data = data[n:]
        return length + self.packet
Write outgoing message.