Error errno 9 bad file descriptor socket

socket( ) ( or whatever you have) into the loop. ( Or, if you prefer, use create_ connection instead of doing it in two steps, which makes this harder to get wrong,. i resolved this problem at the past,. You have a duplicate client_ socket. close( ) line indented in your inner while loop. This means that you try to recieve data from the closed socket, which raises that error. Also, why are you closing the server_ socket in the. The reason is that you are trying to reconnect a closed socket. You have to either create a new socket or reuse the old one as long as it' s connected. In method def sentHOT(. ) : comment the line self. close( ) and in method def. You can' t use the socket once it' s closed. The docs for socket.

  • Ошибка 628 континент ап 3 7
  • View blue screen dump windows 7
  • Error 500 no facebook
  • Polaris rzr 800 error code 21

  • Video:File errno descriptor

    Descriptor socket errno

    close( ) say: All future operations on the socket object will fail. You could create a new socket in the loop. OSError: [ Errno 9] Bad file descriptor · python sockets. It' s my client: # CLIENT import socket conne = socket. once i found the same error, it was because of closing the Python file from " the outside", i. not from the file object' s. You will need to create a new socket object. socket( ) after closing the previous socket and before connecting. You are closing the server' s listening socket, and after that calling again accept( ) on it. To finish receiving one file you should close client connection' s socket ( sock in function receiveFile). Just move the s = socket. Note that as written, the loop terminates when the other side closes the socket causing the recv( ) to return a blank string, which terminates the while loop. But, in your case the client doesn' t close the socket after its send( ), so.