rendered paste body#include "socket.h"#include "networkstream.h"#include <stdio.h>#include <string>using namespace std;int main(int argc, char *argv[]){ try { Socket s(PF_INET, SOCK_STREAM, 0); s.Connect("www.google.com", 80); NetworkStream ns(&s); char buf[] = "GET / HTTP/1.1\nHost: www.google.com\n\n"; ns.Write(buf, sizeof(buf)); char readbuf[10240]; memset(readbuf, 0, sizeof(readbuf)); ns.Read(readbuf, sizeof(readbuf)); printf("Data received:\n%s\n", readbuf); } catch(Exception *e) { printf("An exception was unhandled at %s: \n%s\n", e->Location().c_str(), e->Message().c_str()); delete e; } catch(Exception e) { printf("An exception was unhandled at %s: \n%s\n", e.Location().c_str(), e.Message().c_str()); } catch(...) { printf("Something else was caught! OMG!\n"); }}