Exemplo n.º 1
0
        def WRITE(self, data):
            from pypy.rlib._rsocket_rffi import send, geterrno

            length = send(self.fd, data, len(data), 0)
            if length < 0:
                raise WindowsError(geterrno(), "send")
            return length
Exemplo n.º 2
0
 def send_raw(self, dataptr, length, flags=0):
     """Send data from a CCHARP buffer."""
     res = -1
     timeout = self._select(True)
     if timeout == 1:
         raise SocketTimeout
     elif timeout == 0:
         res = _c.send(self.fd, dataptr, length, flags)
     if res < 0:
         raise self.error_handler()
     return res
Exemplo n.º 3
0
 def send_raw(self, dataptr, length, flags=0):
     """Send data from a CCHARP buffer."""
     res = -1
     timeout = self._select(False)
     if timeout == 1:
         raise SocketTimeout
     elif timeout == 0:
         res = _c.send(self.fd, dataptr, length, flags)
     if res < 0:
         raise self.error_handler()
     return res
Exemplo n.º 4
0
 def WRITE(self, data):
     from pypy.rlib._rsocket_rffi import send, geterrno
     length = send(self.fd, data, len(data), 0)
     if length < 0:
         raise WindowsError(geterrno(), "send")
     return length