<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/extmod/modwebsocket.c, branch 2.1.0</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=2.1.0</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=2.1.0'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2017-07-24T08:43:14+00:00</updated>
<entry>
<title>all: Don't include system errno.h when it's not needed.</title>
<updated>2017-07-24T08:43:14+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-07-24T08:43:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=aa7be82a4dff59b22763abbe1bd5e74c0e37b453'/>
<id>urn:sha1:aa7be82a4dff59b22763abbe1bd5e74c0e37b453</id>
<content type='text'>
</content>
</entry>
<entry>
<title>various: Spelling fixes</title>
<updated>2017-05-29T08:36:05+00:00</updated>
<author>
<name>Ville Skyttä</name>
<email>ville.skytta@iki.fi</email>
</author>
<published>2017-05-29T07:08:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ca16c3821053e5bf2b87aeb10007f73f31dc1eac'/>
<id>urn:sha1:ca16c3821053e5bf2b87aeb10007f73f31dc1eac</id>
<content type='text'>
</content>
</entry>
<entry>
<title>all: Remove 'name' member from mp_obj_module_t struct.</title>
<updated>2016-09-21T14:23:16+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-09-21T00:52:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=93c4a6a3f70e389b466fbc7a4f1ad2e1df87c93f'/>
<id>urn:sha1:93c4a6a3f70e389b466fbc7a4f1ad2e1df87c93f</id>
<content type='text'>
One can instead lookup __name__ in the modules dict to get the value.
</content>
</entry>
<entry>
<title>extmod/modwebsocket: Use mp_rom_map_elem_t and friends.</title>
<updated>2016-08-06T13:18:03+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-08-06T13:18:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=cbef0dba2eef29757237dfe4bca3d21e6a81a0ba'/>
<id>urn:sha1:cbef0dba2eef29757237dfe4bca3d21e6a81a0ba</id>
<content type='text'>
</content>
</entry>
<entry>
<title>extmod/modwebsocket: Make compatible with non-default object models.</title>
<updated>2016-08-06T12:53:16+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-08-06T12:53:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=e0d49b7e1bea90e742e6db81ec91903fd8755c3c'/>
<id>urn:sha1:e0d49b7e1bea90e742e6db81ec91903fd8755c3c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>extmod/modwebsocket: Add readline method.</title>
<updated>2016-08-06T12:13:26+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-08-06T12:13:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a931c4eeecda56139e2aabb71799bc58fd3ae287'/>
<id>urn:sha1:a931c4eeecda56139e2aabb71799bc58fd3ae287</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>extmod/modwebsocket: Add readinto() method.</title>
<updated>2016-07-02T11:03:49+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-07-02T11:03:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=03b0279c6db473c0597e41204ad2f9803ba557d1'/>
<id>urn:sha1:03b0279c6db473c0597e41204ad2f9803ba557d1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>all: Rename mp_obj_type_t::stream_p to protocol.</title>
<updated>2016-06-18T15:44:57+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-06-18T15:19:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=07209f8592f15435d6abbccaad5347cea2c7722e'/>
<id>urn:sha1:07209f8592f15435d6abbccaad5347cea2c7722e</id>
<content type='text'>
It's now used for more than just stream protocol (e.g. pin protocol), so
don't use false names.
</content>
</entry>
<entry>
<title>extmod/modwebsocket: Add close() method.</title>
<updated>2016-05-20T18:18:49+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-05-20T18:18:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ccf4e5ab7baf54b35b1cc4918a38932d21c65424'/>
<id>urn:sha1:ccf4e5ab7baf54b35b1cc4918a38932d21c65424</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/stream: Support both "exact size" and "one underlying call" operations.</title>
<updated>2016-05-17T23:41:45+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-05-17T23:40:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7f7c84b10a5f3b2f783955b01f55e0f913ac459f'/>
<id>urn:sha1:7f7c84b10a5f3b2f783955b01f55e0f913ac459f</id>
<content type='text'>
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.
</content>
</entry>
</feed>
