-
Notifications
You must be signed in to change notification settings - Fork 127
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
write_fixed_all #184
write_fixed_all #184
Conversation
The example is the classic TCP echo server that in this case can serve up to two connections simultaneously. The example creates a fixed buffer register with two entries. The example does not yet use a write_all function for ensuring everything is written back. It is expected a write_all helper will be provided later for the write_fixed call.
Define write_all functions that take fixed buffers. Adds write_fixed_all for TCP and Unix streams. Adds write_fixed_all_at for File.
@FrankReh This should also be applicable to udp and (I think) also the zero copy variants |
@ollie-etl Turns out the UdpSocket can take a write, as it can be connected separately first, so even write_fixed should be defined for the UdpSocket. Just realized that today. |
@ollie-etl Actually, could you clarify what you meant? An _all option doesn't seem necessary for UDP sockets as the writes have to be all or nothing anyway. |
@FrankReh I meant write_fixed, rather than write_fixed_all. An explosion in number of methods is occurring. I think the case for a builder API overhaul is growing stronger |
And realised my initial comment was irrelevant. Please disregard |
Define write_all functions that take fixed buffers.
Adds write_fixed_all for TCP and Unix streams.
Adds write_fixed_all_at for File.
Also adds an example: tcp_listener_fixed_buffers that uses read_fixed and write_fixed_all.