예제 #1
0
파일: sockets.py 프로젝트: DigitEgal/libzt
    def send(self, data, flags=0):
        """send(data[, flags]) -> count

        Write data to the socket.  Returns the number of bytes sent, which
        may be less than the full data size if the network is busy.
        Optional flags may be:

          - ZTS_MSG_PEEK - Peeks at an incoming message.
          - ZTS_MSG_DONTWAIT - Nonblocking I/O for this operation only.
          - ZTS_MSG_MORE - Sender will send more.
        """
        err = libzt.zts_py_send(self._fd, data, flags)
        if err < 0:
            handle_error(err)
        return err
예제 #2
0
파일: sockets.py 프로젝트: TuskAW/libzt
 def send(self, data, flags=0):
     """Write data to the socket"""
     err = libzt.zts_py_send(self._fd, data, len(data), flags)
     if err < 0:
         handle_error(err)
     return err