Dec-09-2016, 12:44 PM
I am trying to get the pending data size in output buffer after calling my socket's sendall(). I am using TCP (non-blocking) socket in a class. My code for send message function in the class is as follows:
def send_data(self, msg): try: status_of_send = self.client.sendall(msg) buffer = array.array('I', [0]) pending = fcntl.ioctl(self.tcp_socket.fileno(), termios.TIOCOUTQ, buffer, True) print pending except socket.error as e: print 'Error while sending data: %s', eOn calling to this function, an Error is occurring as follows:
TraceBack (most recent call last): File "server.py", line 199, in send_date pending = fcntl.ioctl(self.tcp_socket.fileno(), termios.TIOCOUTQ, buffer, True) IOERROR: [Errno 22] Invalid argumentCan any one help me with this??