From fde44cba0815f626253c0d352cd0d782eec94328 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Sun, 11 Jan 2015 11:21:18 +0100 Subject: cNetwork: Implemented HostnameToIP lookups. --- tests/Network/Google.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'tests/Network/Google.cpp') 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 #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"); } + + + + -- cgit v1.2.3