In the code of the child you close sockfd , which represents the server. But in the next iteration of the infinite for-loop, which the child also runs, ...
Socket bad file descriptor openssl errno=9 ... Make sure that the date and time on the server is correct (The wrong time will cause the SSL certificate connection ...
2 Answers2. 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). What you'll need is something to break out of the while True loop when you want to shut down the server.
18.10.2011 · "Bad file descriptor" on close usually means the descriptor has already been closed. This is often because of a double-close bug in some completely unrelated section of the program. Such a bug can be contagious.
but all I get is the following socket error: error: [Errno 9] Bad file descriptor. The host:port accepts connections as I have verified this with nc host ...
The following receiveFile() function reads a filename and file data from ... But I am unable to close the socket and a Bad file descriptor error is raised.
16.11.2015 · You cannot create a file descriptor with value more then 1023. In case of file descriptor of value 1024, it will return an error of EBADF (bad file descriptor, error no-9). When a negative value of file descriptor is returned it indicates that an error has occurred. Share Improve this answer edited Nov 16 '15 at 21:31 Mateusz Piotrowski 6,540 9 46
18.07.2012 · For me, RS485 is a bit of black magic, and I've never used RS485 devices! That why I need testers each time I change something in this front ;) RS485 communication is a mess (bad hardware, incomplete driver, many ways to set up the communication, etc) and to help you (or mislead you), libmodbus try to enable SER_RS485_ENABLED when you want to use RS485 but …
07.10.2021 · [Errno 9] Bad File Descriptor in Python Socket Module Another main area in which this error is seen is in the Python socket – Socket error Bad file descriptor. When dealing with this kind of program, you can notice that you will find a Bad file descriptor error message is seen along with some issues in opening/closing or accessing the socket.
13.09.2018 · If you close a socket, the handle (descriptor) stops being valid, so any operation started after that would complain about the handle not being valid. (worse, it could be reused for a new file/connection and you might end up talking to the wrong party, causing undefined behaviour or data corruption. I've seen a bug like that live. Not fun to debug)
You're calling connect on the same socket you closed. You can't do that. As for the docs for close say: All future operations on the socket object will fail ...