Socket error -78 and errorno 9

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
yehiatharwat
Posts: 2
Joined: Tue Jun 20, 2017 8:08 am

Socket error -78 and errorno 9

Post by yehiatharwat » Tue Jun 20, 2017 1:40 pm

Hello,

Using urequests library on a LoPy: I get OSError -78 and errno 9 when doing get/post https requests. It only happens after running the application for several hours. Can anyone shed some light as to what OSError -78 stands for? and what errno 9 (Ebadf) means? Or maybe point me to the right direction?

Thank you!

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Socket error -78 and errorno 9

Post by pythoncoder » Wed Jun 21, 2017 5:31 am

Queries regarding PyCom products are best raised in their forum https://forum.pycom.io/. As a very general point many issues involving failures of network devices after long periods of time proved to be down to not closing sockets. This results in socket instances proliferating until RAM is exhausted.
Peter Hinch
Index to my micropython libraries.

yehiatharwat
Posts: 2
Joined: Tue Jun 20, 2017 8:08 am

Re: Socket error -78 and errorno 9

Post by yehiatharwat » Wed Jun 21, 2017 9:33 am

Thank you for replying. I have posted to the Pycom forum, hopefully someone will answer. The reason I posted here as well is because I assume these errors are defined in Micropython as a whole so I could get an answer to what they mean. Since the urequests library handles the opening and closing of the sockets, I am sure there are no open sockets left after an HTTP request.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Socket error -78 and errorno 9

Post by pythoncoder » Thu Jun 22, 2017 11:37 am

Error no. 9 is a standard Python code for a bad file number (defined in errno.py). Maybe -78 is something PyCom specific?
Peter Hinch
Index to my micropython libraries.

Post Reply