-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Factor out ensure_writeable methods.
There is some important logic that is easy to overlook in the client and server channels: streams of data to write to the transport should not be polled until the transport is known to be ready to buffer a message. In the case that a transport's buffer is full, it needs to be flushed to make room for more messages. Without this logic, start_send() could return an error when the buffer is full, which would cause the entire Channel to error out. Due to the importance of this logic, it's now factored out into its own method that's easier to understand: fn ensure_writeable. There is one in the client module and and one in the server module.
- Loading branch information
Showing
2 changed files
with
102 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters