1 #include <Sockets/HttpGetSocket.h>
2 #include <Sockets/SocketHandler.h>
3 #include <Sockets/Exception.h>
4 #include <Sockets/StdoutLog.h>
5 #include <Sockets/File.h>
6 #include <iostream>
7 
main(int argc,char * argv[])8 int main(int argc, char *argv[])
9 {
10 	if (argc < 2)
11 		return -1;
12 	try
13 	{
14 		File fil("httpget.out", "w");
15 		StdoutLog log;
16 		SocketHandler h(&log);
17 		HttpGetSocket sock(h, argv[1], "empty.html");
18 		sock.SetTrafficMonitor(&fil);
19 		h.Add(&sock);
20 		while (h.GetCount())
21 			h.Select();
22 	}
23 	catch (const Exception& e)
24 	{
25 		std::cerr << e.ToString() << std::endl;
26 	}
27 }
28