Skip to content

Connection handling improvements, measurements for dimensioning#6

Merged
szeka9 merged 7 commits into
mainfrom
development
Apr 11, 2026
Merged

Connection handling improvements, measurements for dimensioning#6
szeka9 merged 7 commits into
mainfrom
development

Conversation

@szeka9
Copy link
Copy Markdown
Owner

@szeka9 szeka9 commented Apr 11, 2026

  • improved module naming
  • use context manager and prevent the use of stale connection objects
  • reject incomplete HTTP requests if the client sends EOF
  • remove main() from http_server and allow applications to directly take control of the asyncio event loop with asyncio.run()
  • create dimensioning guide and measurements for ESP32-S3 and ESP32-C3

szeka9 added 7 commits April 7, 2026 23:05
Rename socket_http.py to http_connection.py
and socket.py to connection.py to to reflect
that these classes wrap asyncio streams rather
than raw sockets.

Rename parent module for connectivity related modules
from 'con' to 'connectivity'.
Add context manager to BaseConnection to
simplify closing asyncio StreamWriter for
active socket connections.

Rename reader and writer members of the BaseConnection
class to indicate that these are not public members.

Additionally, add connection checking to the public read(),
write() and close() methods to prevent reusing stale connection
objects (e.g. when the asyncio server is terminated
asynchronously while there are active connections).
Currently, the server waits until a proper
state machine termination or timeout exception,
not addressing the case when a client sends
an incomplete request.

Instead, respond with HTTP 400 when EOF is received
before the state machine is properly terminated.
Remove main() from the HTTP server module,
invoke asyncio.run() in boot.py to initiate
the event loop.

Update Makefile and documentation about app
deployment. Instead of using mpremote run,
always deploy app.py and boot.py to the device.
Also, update the default list of rules.
Only delete project-related files,
use more robust error handling to
prevent partial cleanups.
This commit includes new automations for system testing
focusing on heap usage with respect to feature enablement.

Additionally, add documentation and measurement for dimensioning
on ESP32-S3 and ESP32-C3.
@szeka9 szeka9 merged commit 39cad1a into main Apr 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant