Description
We currently have 4 different modusocket
implementations, all supposed to expose the exact same interface.
I believe lots of the code can be shared. There's lot of parameters handling and conversion between mp_obj_t
to simple data types, and vice versa. Most of the systems do expose a BSD sockets API, or, at least, their API can be easily wrapped to achieve the BSD sockets API.
Having multiple implementations of the pythonic API is bad because things go wrong and little inconsistencies show up between different ports. Generally I think the pythonic API should be implemented only once, so having a file like utime_mphal.c
is a nicer way.
Also, when the python API impl is done, it's easier to now implement it for more ports.
Would modusocket_mphal.c
do it?