-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added TCPConnection.on_shutdown() and TCPConnection.on_close()
- both methods must be overloaded by the network adapter, just like TCPConnection.on_data() - on_shutdown() informs the network adapter that the client has closed its half of the connection (FIN) - on_close() informs the network adapter that the client has fully closed the connection (RST) - added call to on_shutdown() when we receive a TCP packet with active FIN flag from guest - added call to on_close() when we receive a TCP packet with active RST flag from guest - added calls to on_close() when we have to tear down the connection in fake_network.js - added implementation of on_shutdown() and on_close() in wisp_network.js The default implementation of these methods is to do nothing. These methods do not apply to fetch-based networking, fetch() only supports HTTP and it doesn't matter if the client closes its end of the connection after it has sent its HTTP request. Hence FetchNetworkAdapter does not override these methods. Note that WISP currently only supports close(), as a workaround shutdown() is implemented like close() which might be incorrect (missing support for half-closed TCP connections).
- Loading branch information
Showing
2 changed files
with
37 additions
and
8 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