1. 12 2月, 2019 1 次提交
  2. 17 10月, 2018 2 次提交
    • P
      unix/modusocket: Finish socket.settimeout() implementation. · 0c18633e
      Paul Sokolovsky 提交于
      1. Return correct error code for non-blocking vs timed out socket
      (POSIX returns EAGAIN for both, we want ETIMEDOUT in case of timed
      out socket). To achieve this, blocking/non-blocking flag is added
      to the mp_obj_socket_t, to avoid issuing fcntl() syscall each time
      EAGAIN occurs. (mp_obj_socket_t used to be 8 bytes, having some room
      in a standard 16-byte alloc block.)
      
      2. Handle socket.settimeout(0) properly - in Python, that means
      non-blocking mode, but SO_RCVTIMEO/SO_SNDTIMEO of 0 is infinite
      timeout.
      
      3. Overall, make sure that socket.settimeout() call switches blocking
      state as expected.
      0c18633e
    • D
  3. 20 7月, 2018 1 次提交
    • D
      unix: Use MP_STREAM_GET_FILENO to allow uselect to poll general objects. · ef554ef9
      Damien George 提交于
      This mechanism will scale to to an arbitrary number of pollable objects, so
      long as they implement the MP_STREAM_GET_FILENO ioctl.  Since ussl objects
      pass through ioctl requests transparently to the underlying socket object,
      it will allow ussl sockets to be polled.  And a user object with uio.IOBase
      as a base could support polling.
      ef554ef9
  4. 10 4月, 2018 1 次提交
    • D
      py/stream: Switch stream close operation from method to ioctl. · cf31d384
      Damien George 提交于
      This patch moves the implementation of stream closure from a dedicated
      method to the ioctl of the stream protocol, for each type that implements
      closing.  The benefits of this are:
      
      1. Rounds out the stream ioctl function, which already includes flush,
         seek and poll (among other things).
      
      2. Makes calling mp_stream_close() on an object slightly more efficient
         because it now no longer needs to lookup the close method and call it,
         rather it just delegates straight to the ioctl function (if it exists).
      
      3. Reduces code size and allows future types that implement the stream
         protocol to be smaller because they don't need a dedicated close method.
      
      Code size reduction is around 200 bytes smaller for x86 archs and around
      30 bytes smaller for the bare-metal archs.
      cf31d384
  5. 25 10月, 2017 1 次提交
  6. 23 10月, 2017 1 次提交
  7. 04 10月, 2017 1 次提交
    • D
      all: Remove inclusion of internal py header files. · a3dc1b19
      Damien George 提交于
      Header files that are considered internal to the py core and should not
      normally be included directly are:
          py/nlr.h - internal nlr configuration and declarations
          py/bc0.h - contains bytecode macro definitions
          py/runtime0.h - contains basic runtime enums
      
      Instead, the top-level header files to include are one of:
          py/obj.h - includes runtime0.h and defines everything to use the
              mp_obj_t type
          py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h,
              and defines everything to use the general runtime support functions
      
      Additional, specific headers (eg py/objlist.h) can be included if needed.
      a3dc1b19
  8. 06 9月, 2017 1 次提交
  9. 31 7月, 2017 1 次提交
  10. 12 7月, 2017 1 次提交
  11. 29 5月, 2017 1 次提交
  12. 14 11月, 2016 1 次提交
  13. 07 10月, 2016 2 次提交
  14. 21 9月, 2016 1 次提交
  15. 07 8月, 2016 1 次提交
  16. 18 6月, 2016 1 次提交
  17. 05 4月, 2016 1 次提交
  18. 02 3月, 2016 1 次提交
  19. 28 1月, 2016 1 次提交
  20. 22 1月, 2016 1 次提交
  21. 11 1月, 2016 4 次提交
  22. 29 11月, 2015 2 次提交
  23. 21 11月, 2015 3 次提交
  24. 10 10月, 2015 1 次提交
  25. 15 7月, 2015 1 次提交
    • P
      unix: modsocket: Implement inet_pton() in preference of inet_aton(). · c48740e2
      Paul Sokolovsky 提交于
      inet_pton supports both ipv4 and ipv6 addresses. Interface is also extensible
      for other address families, but underlying libc inet_pton() function isn't
      really extensible (e.g., it doesn't return length of binary address, i.e. it's
      really hardcoded to AF_INET and AF_INET6). But anyway, on Python side, we could
      extend it to support other addresses.
      c48740e2
  26. 14 7月, 2015 1 次提交
  27. 12 7月, 2015 1 次提交
    • P
      unix: modsocket: Implement sendto(). · 3b83aeb4
      Paul Sokolovsky 提交于
      sendto() turns out to be mandatory function to work with UDP. It may seem
      that connect(addr) + send() would achieve the same effect, but what connect()
      appears to do is to set source address filter on a socket to its argument.
      Then everything falls apart: socket sends to a broad-/multi-cast address,
      but reply is sent from real peer address, which doesn't match filter set
      by connect(), so local socket never sees a reply.
      3b83aeb4
  28. 11 7月, 2015 1 次提交
  29. 10 7月, 2015 1 次提交
  30. 16 4月, 2015 1 次提交
    • D
      py: Overhaul and simplify printf/pfenv mechanism. · 7f9d1d6a
      Damien George 提交于
      Previous to this patch the printing mechanism was a bit of a tangled
      mess.  This patch attempts to consolidate printing into one interface.
      
      All (non-debug) printing now uses the mp_print* family of functions,
      mainly mp_printf.  All these functions take an mp_print_t structure as
      their first argument, and this structure defines the printing backend
      through the "print_strn" function of said structure.
      
      Printing from the uPy core can reach the platform-defined print code via
      two paths: either through mp_sys_stdout_obj (defined pert port) in
      conjunction with mp_stream_write; or through the mp_plat_print structure
      which uses the MP_PLAT_PRINT_STRN macro to define how string are printed
      on the platform.  The former is only used when MICROPY_PY_IO is defined.
      
      With this new scheme printing is generally more efficient (less layers
      to go through, less arguments to pass), and, given an mp_print_t*
      structure, one can call mp_print_str for efficiency instead of
      mp_printf("%s", ...).  Code size is also reduced by around 200 bytes on
      Thumb2 archs.
      7f9d1d6a
  31. 20 1月, 2015 1 次提交
  32. 02 1月, 2015 1 次提交