diff options
author | Mattes D <github@xoft.cz> | 2015-01-11 11:21:18 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-01-22 20:12:45 +0100 |
commit | fde44cba0815f626253c0d352cd0d782eec94328 (patch) | |
tree | a25648d28be80c624b3fea7240c8449991d08564 /tests/Network/Google.cpp | |
parent | Excluded PolarSSL tests from MCS tests. (diff) | |
download | cuberite-fde44cba0815f626253c0d352cd0d782eec94328.tar cuberite-fde44cba0815f626253c0d352cd0d782eec94328.tar.gz cuberite-fde44cba0815f626253c0d352cd0d782eec94328.tar.bz2 cuberite-fde44cba0815f626253c0d352cd0d782eec94328.tar.lz cuberite-fde44cba0815f626253c0d352cd0d782eec94328.tar.xz cuberite-fde44cba0815f626253c0d352cd0d782eec94328.tar.zst cuberite-fde44cba0815f626253c0d352cd0d782eec94328.zip |
Diffstat (limited to 'tests/Network/Google.cpp')
-rw-r--r-- | tests/Network/Google.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/tests/Network/Google.cpp b/tests/Network/Google.cpp index 0aa52d025..de5f95e1f 100644 --- a/tests/Network/Google.cpp +++ b/tests/Network/Google.cpp @@ -1,11 +1,17 @@ -#include "Globals.h" +// Google.cpp + +// Implements a HTTP download of the google's front page using the LibEvent-based cNetwork API +#include "Globals.h" #include <thread> #include "OSSupport/Event.h" - #include "OSSupport/Network.h" + + + + /** Connect callbacks that send a HTTP GET request for google.com when connected. */ class cHTTPConnectCallbacks: public cNetwork::cConnectCallbacks @@ -35,6 +41,9 @@ public: }; + + + /** cTCPLink callbacks that dump everything it received to the log. */ class cDumpCallbacks: public cTCPLink::cCallbacks @@ -69,7 +78,11 @@ public: }; -int main() { + + + +int main() +{ cEvent evtFinish; LOGD("Network test: Connecting to google.com:80, reading front page via HTTP."); @@ -83,3 +96,7 @@ int main() { evtFinish.Wait(); LOGD("Network test finished"); } + + + + |