diff options
Diffstat (limited to 'unix/modsocket.c')
-rw-r--r-- | unix/modsocket.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/unix/modsocket.c b/unix/modsocket.c index 16039bd813..d6f732377d 100644 --- a/unix/modsocket.c +++ b/unix/modsocket.c @@ -50,6 +50,21 @@ #include "stream.h" #include "builtin.h" +/* + The idea of this module is to implement reasonable minimum of + socket-related functions to write typical clients and servers. + The module named "microsocket" on purpose, to allow to make + Python-level module more (or fully) compatible with CPython + "socket", e.g.: + ---- socket.py ---- + from microsocket import * + from socket_more_funcs import * + from socket_more_funcs2 import * + ------------------- + I.e. this module should stay lean, and more functions (if needed) + should be add to seperate modules (C or Python level). + */ + #define MICROPY_SOCKET_EXTRA (0) typedef struct _mp_obj_socket_t { @@ -283,10 +298,6 @@ STATIC const mp_map_elem_t microsocket_locals_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_setsockopt), (mp_obj_t)&socket_setsockopt_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_setblocking), (mp_obj_t)&socket_setblocking_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_close), (mp_obj_t)&socket_close_obj }, -#if MICROPY_SOCKET_EXTRA - { MP_OBJ_NEW_QSTR(MP_QSTR_recv), (mp_obj_t)&mp_stream_read_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_send), (mp_obj_t)&mp_stream_write_obj }, -#endif }; STATIC MP_DEFINE_CONST_DICT(microsocket_locals_dict, microsocket_locals_dict_table); |