Socket handler setup

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
Roberthh
Posts: 2069
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Socket handler setup

Post by Roberthh » Sun Oct 09, 2016 4:47 pm

I see this line e.g. in webrepl:

Code: Select all

setsockopt(socket.SOL_SOCKET, 20, handler) 
I can guess the purpose, but is that somewhere documented? And were is it implemented?

chrisgp
Posts: 41
Joined: Fri Apr 01, 2016 5:29 pm

Re: Socket handler setup

Post by chrisgp » Sun Oct 09, 2016 7:48 pm

This commit is pretty relevant and should show how it works: https://github.com/micropython/micropyt ... abe0ea66e3

I wasn't able to find any documentation on it when I looked it up and I would be curious why the literal value 20 was used.

User avatar
Roberthh
Posts: 2069
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Socket handler setup

Post by Roberthh » Sun Oct 09, 2016 8:07 pm

Thanks. I'm trying to set up the background ftp server. For single command it works, but for two stage commands it looks like the seconds connection disappears between commands. I have to dig further.
Update: Some progress, although with a hammer. ls command works.

Post Reply