-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
RFC: Create a common usocket_mphal #4475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The problem with unifying the
If some kind of unification was done (which is a good thing to consider) then it would be very important to retain the efficiency of how (1) is currently implemented. |
Sorry, closed in error. |
I'll give it a shot while keeping in mind about efficiency and code size (which tend to get hurt while generalizing stuff). Start with something small and see if we find it useful. |
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?The text was updated successfully, but these errors were encountered: