Skip to content
Snippets Groups Projects
  1. May 28, 2019
  2. May 17, 2019
  3. May 08, 2019
  4. Feb 12, 2019
  5. Oct 17, 2018
    • Paul Sokolovsky's avatar
      unix/modusocket: Finish socket.settimeout() implementation. · 0c18633e
      Paul Sokolovsky authored
      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
    • Danielle Madeley's avatar
  6. Jul 20, 2018
    • Damien George's avatar
      unix: Use MP_STREAM_GET_FILENO to allow uselect to poll general objects. · ef554ef9
      Damien George authored
      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
  7. Apr 10, 2018
    • Damien George's avatar
      py/stream: Switch stream close operation from method to ioctl. · cf31d384
      Damien George authored
      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
  8. Oct 24, 2017
  9. Oct 23, 2017
  10. Oct 04, 2017
    • Damien George's avatar
      all: Remove inclusion of internal py header files. · a3dc1b19
      Damien George authored
      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
  11. Sep 06, 2017
  12. Jul 31, 2017
  13. Jul 12, 2017
  14. May 29, 2017
  15. Nov 13, 2016
  16. Oct 07, 2016
  17. Sep 21, 2016
  18. Aug 06, 2016
  19. Jun 18, 2016
  20. Apr 04, 2016
  21. Mar 01, 2016
  22. Jan 27, 2016
  23. Jan 21, 2016
  24. Jan 11, 2016
  25. Nov 29, 2015
  26. Nov 21, 2015
  27. Nov 20, 2015
  28. Oct 10, 2015
  29. Jul 14, 2015
    • Paul Sokolovsky's avatar
      unix: modsocket: Implement inet_pton() in preference of inet_aton(). · c48740e2
      Paul Sokolovsky authored
      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
  30. Jul 13, 2015
  31. Jul 12, 2015
    • Paul Sokolovsky's avatar
      unix: modsocket: Implement sendto(). · 3b83aeb4
      Paul Sokolovsky authored
      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
  32. Jul 10, 2015
Loading