forked from jtroo/kanata
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tcp): add keep-alive, split client/server messages
This commit sets a 30-second keep-alive on opened TcpStreams (using net2::TcpStreamExt as keep-alive functionality is not currently in the standard library) and splits the previous EventNotification enum into a ServerMessage and a ClientMessage enum respectively. I have changed the semantics between ServerMessage and ClientMessage slightly so that ClientMessage variants are imperative requests that align closer with the names of the handler functions, ie. ChangeLayer calls fn change_layer(). Whenever a client's TcpStream cannot be written to, either because it has notified the server of a disconnect or because it has failed the keep-alive, it will be removed from the connections HashMap on the TcpServer struct. re jtroo#47
- Loading branch information
Showing
4 changed files
with
45 additions
and
21 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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