summaryrefslogtreecommitdiffstatshomepage
path: root/extmod/modwebsocket.c
Commit message (Collapse)AuthorAge
* all: Remove 'name' member from mp_obj_module_t struct.Damien George2016-09-22
| | | | One can instead lookup __name__ in the modules dict to get the value.
* extmod/modwebsocket: Use mp_rom_map_elem_t and friends.Paul Sokolovsky2016-08-06
|
* extmod/modwebsocket: Make compatible with non-default object models.Paul Sokolovsky2016-08-06
|
* extmod/modwebsocket: Add readline method.Paul Sokolovsky2016-08-06
| | | | | | This goes bit against websocket nature (message-based communication), as it ignores boundaries bertween messages, but may be very practical to do simple things with websockets.
* extmod/modwebsocket: Add readinto() method.Paul Sokolovsky2016-07-02
|
* all: Rename mp_obj_type_t::stream_p to protocol.Paul Sokolovsky2016-06-18
| | | | | It's now used for more than just stream protocol (e.g. pin protocol), so don't use false names.
* extmod/modwebsocket: Add close() method.Paul Sokolovsky2016-05-20
|
* py/stream: Support both "exact size" and "one underlying call" operations.Paul Sokolovsky2016-05-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both read and write operations support variants where either a) a single call is made to the undelying stream implementation and returned buffer length may be less than requested, or b) calls are repeated until requested amount of data is collected, shorter amount is returned only in case of EOF or error. These operations are available from the level of C support functions to be used by other C modules to implementations of Python methods to be used in user-facing objects. The rationale of these changes is to allow to write concise and robust code to work with *blocking* streams of types prone to short reads, like serial interfaces and sockets. Particular object types may select "exact" vs "once" types of methods depending on their needs. E.g., for sockets, revc() and send() methods continue to be "once", while read() and write() thus converted to "exactly" versions. These changes don't affect non-blocking handling, e.g. trying "exact" method on the non-blocking socket will return as much data as available without blocking. No data available is continued to be signaled as None return value to read() and write(). From the point of view of CPython compatibility, this model is a cross between its io.RawIOBase and io.BufferedIOBase abstract classes. For blocking streams, it works as io.BufferedIOBase model (guaranteeing lack of short reads/writes), while for non-blocking - as io.RawIOBase, returning None in case of lack of data (instead of raising expensive exception, as required by io.BufferedIOBase). Such a cross-behavior should be optimal for MicroPython needs.
* extmod/modwebsocket: Handle CLOSE control frame.Paul Sokolovsky2016-04-27
| | | | | This fixes situation when clients hangs waiting for disconnect and does so only on timeout.
* extmod/modwebsocket: Another case to propagate EOF.Paul Sokolovsky2016-04-13
|
* extmod/modwebsocket: write(): Support write size beyond 125 bytes.Paul Sokolovsky2016-04-11
|
* extmod/modwebsocket.h: Split websocket-related defines for reuse.Paul Sokolovsky2016-04-10
|
* extmod/modwebsocket: Implement MP_STREAM_SET_DATA_OPTS ioctl.Paul Sokolovsky2016-04-10
| | | | Allows to set fragment type (txt/bin/etc.) for output records.
* extmod/modwebsocket: Allow to get type of last read data using ioctl().Paul Sokolovsky2016-04-10
|
* extmod/modwebsocket: Record current fragment type (binary/text/etc.)Paul Sokolovsky2016-04-09
| | | | Also, handle continuation frames (untested).
* extmod/modwebsocket: Add option for blocking writes to non-blk sockets.Paul Sokolovsky2016-04-09
| | | | | | | | | | This is strange asymmetry which is sometimes needed, e.g. for WebREPL: we want to process only available input and no more; but for output, we want to get rid of all of it, because there's no other place to buffer/store it. This asymmetry is akin to CPython's asyncio asymmetry, where reads are asynchronous, but writes are synchronous (asyncio doesn't expect them to block, instead expects there to be (unlimited) buffering for any sync write to completely immediately).
* extmod/modwebsocket: Reset mask between packets.Paul Sokolovsky2016-04-09
|
* extmod/modwebsocket: Make sure to propagate EOF.Paul Sokolovsky2016-04-08
|
* extmod/modwebsocket: Properly check number of args to constructor.Paul Sokolovsky2016-04-08
|
* extmod/modwebsocket: Implement read support.Paul Sokolovsky2016-03-25
|
* extmod/modwebsocket: Start module for WebSocket helper functions.Paul Sokolovsky2016-03-24
Currently, only write support is implemented (of limited buffer size).