1
0

cNetwork: Implemented HostnameToIP lookups.

This commit is contained in:
Mattes D
2015-01-11 11:21:18 +01:00
parent c7335255ac
commit fde44cba08
6 changed files with 256 additions and 9 deletions

View File

@@ -1,11 +1,17 @@
// 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");
}