summaryrefslogtreecommitdiff
path: root/extmod/modwebsocket.c
AgeCommit message (Collapse)Author
2017-07-24all: Don't include system errno.h when it's not needed.Damien George
2017-05-29various: Spelling fixesVille Skyttä
2016-09-22all: Remove 'name' member from mp_obj_module_t struct.Damien George
One can instead lookup __name__ in the modules dict to get the value.
2016-08-06extmod/modwebsocket: Use mp_rom_map_elem_t and friends.Paul Sokolovsky
2016-08-06extmod/modwebsocket: Make compatible with non-default object models.Paul Sokolovsky
2016-08-06extmod/modwebsocket: Add readline method.Paul Sokolovsky
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.
2016-07-02extmod/modwebsocket: Add readinto() method.Paul Sokolovsky
2016-06-18all: Rename mp_obj_type_t::stream_p to protocol.Paul Sokolovsky
It's now used for more than just stream protocol (e.g. pin protocol), so don't use false names.
2016-05-20extmod/modwebsocket: Add close() method.Paul Sokolovsky
2016-05-18py/stream: Support both "exact size" and "one underlying call" operations.Paul Sokolovsky
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.
2016-04-27extmod/modwebsocket: Handle CLOSE control frame.Paul Sokolovsky
This fixes situation when clients hangs waiting for disconnect and does so only on timeout.
2016-04-13extmod/modwebsocket: Another case to propagate EOF.Paul Sokolovsky
2016-04-11extmod/modwebsocket: write(): Support write size beyond 125 bytes.Paul Sokolovsky
2016-04-10extmod/modwebsocket.h: Split websocket-related defines for reuse.Paul Sokolovsky
2016-04-10extmod/modwebsocket: Implement MP_STREAM_SET_DATA_OPTS ioctl.Paul Sokolovsky
Allows to set fragment type (txt/bin/etc.) for output records.
2016-04-10extmod/modwebsocket: Allow to get type of last read data using ioctl().Paul Sokolovsky
2016-04-09extmod/modwebsocket: Record current fragment type (binary/text/etc.)Paul Sokolovsky
Also, handle continuation frames (untested).
2016-04-09extmod/modwebsocket: Add option for blocking writes to non-blk sockets.Paul Sokolovsky
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).
2016-04-09extmod/modwebsocket: Reset mask between packets.Paul Sokolovsky
2016-04-08extmod/modwebsocket: Make sure to propagate EOF.Paul Sokolovsky
2016-04-08extmod/modwebsocket: Properly check number of args to constructor.Paul Sokolovsky
2016-03-25extmod/modwebsocket: Implement read support.Paul Sokolovsky
2016-03-24extmod/modwebsocket: Start module for WebSocket helper functions.Paul Sokolovsky
Currently, only write support is implemented (of limited buffer size).