changeset 19 | e6b670dbfe3b |
parent 18 | 43a57943af9f |
child 20 | 0e4933d5862e |
--- a/qmsk/net/socket/socket.pyx Mon Aug 17 01:03:40 2009 +0300 +++ b/qmsk/net/socket/socket.pyx Mon Aug 17 01:24:28 2009 +0300 @@ -111,6 +111,16 @@ """ return self.fd + + def setblocking (self, bint blocking = True) : + """ + Control the OS-level nonblocking-IO mode flag for this socket. + + blocking - True for normal blocking operation, False to use non-blocking operation + """ + + # fcntl magic + libc.fcntl_set_flag(self.fd, libc.O_NONBLOCK, not blocking) def bind (self, sockaddr addr) : """