Page 1 of 1

Socket handler setup

Posted: Sun Oct 09, 2016 4:47 pm
by Roberthh
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?

Re: Socket handler setup

Posted: Sun Oct 09, 2016 7:48 pm
by chrisgp
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.

Re: Socket handler setup

Posted: Sun Oct 09, 2016 8:07 pm
by Roberthh
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.