1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Document new TCP stream classes

This commit is contained in:
Matias Fontanini
2016-02-07 19:24:46 -08:00
parent 07b5d74179
commit 5b60b79fd8
6 changed files with 444 additions and 55 deletions

View File

@@ -89,10 +89,6 @@ void on_client_data(Stream& stream) {
// Now print it, prepending some information about the stream
cout << client_endpoint(stream) << " >> "
<< server_endpoint(stream) << ": " << endl << data << endl;
// Now erase the stored data, as we've already processed it. This is important,
// since if we don't do this, the connection will keep buffering data until
// the stream is closed
stream.client_payload().clear();
}
// Whenever there's new server data on the stream, this callback is executed.
@@ -101,7 +97,6 @@ void on_server_data(Stream& stream) {
string data(stream.server_payload().begin(), stream.server_payload().end());
cout << server_endpoint(stream) << " >> "
<< client_endpoint(stream) << ": " << endl << data << endl;
stream.server_payload().clear();
}
// When a connection is closed, this callback is executed.