Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telnet: buffered output for AsyncTcp server #1929

Merged
merged 10 commits into from
Oct 9, 2019
Merged

Conversation

mcspr
Copy link
Collaborator

@mcspr mcspr commented Oct 2, 2019

This is something I had noticed with Sonoff Basic board running lwip2 low-memory
scheduling is +400B
buffering is +1.4KB

Why not AsyncTCPbuffer? -1KB code size and slightly less memory allocations.
And technically, nothing stops us from using this class for something else.

@mcspr
Copy link
Collaborator Author

mcspr commented Oct 5, 2019

It would also make sense to always buffer / add callback (#1909) for shared data (debug, ws announce). But it feels like it would be much easier to implement this with another class that only does that specific thing on a list of clients, pushing chunks of data in a queue until every client has it (...onAck for each client should count written data)

Debugging itself needs a queue of sorts to help with that, but that is a whole other issue.
edit:Linux printk could be used as a reference for some of the parts.
edit:Rsyslog error messaging (LogMsg func), internal message queue (submitMsg2), etc.
edit:Rsyslog queue (internal module)
edit:Syslog-ng's queueing should be explored too
edit2 ... formatting

Also a honorable mention of AsyncPrinter.cpp, but technically we don't need (or want, because of delay() usage) Stream API.

@mcspr mcspr merged commit 1949bc8 into xoseperez:dev Oct 9, 2019
@mcspr mcspr deleted the telnet/buf branch October 9, 2019 20:32
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