<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/extmod/modlwip.c, branch esp-extra-scripts</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=esp-extra-scripts</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=esp-extra-scripts'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2016-06-19T16:15:20+00:00</updated>
<entry>
<title>extmod/modlwip: Store a chain of incoming pbufs, instead of only one.</title>
<updated>2016-06-19T16:15:20+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-06-19T12:53:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=5071ceea077dec32536315549f8d28614f7e0cfc'/>
<id>urn:sha1:5071ceea077dec32536315549f8d28614f7e0cfc</id>
<content type='text'>
Storing a chain of pbuf was an original design of @pfalcon's lwIP socket
module. The problem with storing just one, like modlwip does is that
"peer closed connection" notification is completely asynchronous and out of
band. So, there may be following sequence of actions:

1. pbuf #1 arrives, and stored in a socket.
2. pbuf #2 arrives, and rejected, which causes lwIP to put it into a
queue to re-deliver later.
3. "Peer closed connection" is signaled, and socket is set at such status.
4. pbuf #1 is processed.
5. There's no stored pbufs in teh socket, and socket status is "peer closed
connection", so EOF is returned to a client.
6. pbuf #2 gets redelivered.

Apparently, there's no easy workaround for this, except to queue all
incoming pbufs in a socket. This may lead to increased memory pressure,
as number of pending packets would be regulated only by TCP/IP flow
control, whereas with previous setup lwIP had a global overlook of number
packets waiting for redelivery and could regulate them centrally.
</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/modlwip: Rework how Python accept callback is called.</title>
<updated>2016-05-15T19:42:12+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-05-15T19:14:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=afce978aca77805e84a2442c93c26dab045784f8'/>
<id>urn:sha1:afce978aca77805e84a2442c93c26dab045784f8</id>
<content type='text'>
Calling it from lwIP accept callback will lead incorrect functioning
and/or packet leaks if Python callback has any networking calls, due
to lwIP non-reentrancy. So, instead schedule "poll" callback to do
that, which will be called by lwIP when it does not perform networking
activities. "Poll" callback is called infrequently though (docs say
every 0.5s by default), so for better performance, lwIP needs to be
patched to call poll callback soon after accept callback, but when
current packet is already processed.
</content>
</entry>
<entry>
<title>extmod/modlwip: Convert errno's to use MP_Exxx symbols.</title>
<updated>2016-05-12T11:49:14+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-05-12T11:49:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=0055457b5fb3e4d941503fac1706256a2f2f2dc7'/>
<id>urn:sha1:0055457b5fb3e4d941503fac1706256a2f2f2dc7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>extmod/modlwip: Implement sendall() method for TCP sockets.</title>
<updated>2016-05-03T07:43:11+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-05-03T07:42:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=cfc94bec9ffdb774a6e33d10ad71ef7c69efc957'/>
<id>urn:sha1:cfc94bec9ffdb774a6e33d10ad71ef7c69efc957</id>
<content type='text'>
</content>
</entry>
<entry>
<title>extmod/modlwip: Add print_pcbs() debug function.</title>
<updated>2016-04-26T13:30:13+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-04-26T13:30:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=1c6d91d96846f4c1782052aca29ab7fe12567af8'/>
<id>urn:sha1:1c6d91d96846f4c1782052aca29ab7fe12567af8</id>
<content type='text'>
This requires lwIP built with LWIP_DEBUG (or it will be no-op).
</content>
</entry>
<entry>
<title>extmod/modlwip: Workaround esp8266 sendto issue where 1 is returned.</title>
<updated>2016-04-26T12:19:08+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-04-26T12:19:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=45ac5a85d524d30384cc99944897b5d8d5cf1efb'/>
<id>urn:sha1:45ac5a85d524d30384cc99944897b5d8d5cf1efb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>extmod, stmhal: Fix typo of macro that detects if float is enabled.</title>
<updated>2016-04-26T11:47:24+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-04-26T11:47:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a63542387d1689f05bb102eef83baa2235e6d1e6'/>
<id>urn:sha1:a63542387d1689f05bb102eef83baa2235e6d1e6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>extmod/modlwip: Protect recv/accept Python callback against exceptions.</title>
<updated>2016-04-25T18:27:55+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-04-25T18:26:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7a012f4793c15d082b888591c25f39cb4625dc61'/>
<id>urn:sha1:7a012f4793c15d082b888591c25f39cb4625dc61</id>
<content type='text'>
Using usual call_function_*_protected() helper, to avoid NLR jump crashes.
</content>
</entry>
<entry>
<title>extmod/modlwip: Add ability to run callback on "recv" and "accept" events.</title>
<updated>2016-04-17T15:06:45+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-04-17T15:06:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7d57037906cf0274af08bd2eccbfffabe0ea66e3'/>
<id>urn:sha1:7d57037906cf0274af08bd2eccbfffabe0ea66e3</id>
<content type='text'>
To use: .setsockopt(SOL_SOCKET, 20, lambda sock: print(sock)). There's a
single underlying callback slot. For normal sockets, it serves as data
received callback, for listening sockets - connection arrived callback.
</content>
</entry>
</feed>
