Emacs/cc-ide: More robust function movement
[mediaserv.git] / testclient.cc
1 // $Id$
2 //
3 // Copyright (C) 2006 
4
5 // Definition of non-inline non-template functions
6
7 //#include "testclient.hh"
8 //#include "testclient.ih"
9
10 // Custom includes
11 #include <iostream>
12 #include "Socket/Protocols/INet/TCPSocketHandle.hh"
13 #include "Utils/MicroTime.hh"
14
15 //#include "testclient.mpp"
16 #define prefix_
17 ///////////////////////////////cc.p////////////////////////////////////////
18
19 int main(int argc, char** argv)
20 {
21     senf::TCPv4ClientSocketHandle handle (argv[1]);
22     handle.write(argv[2]);
23     handle.write(" HTTP/1.1\r\n");
24     if (argc>3) {
25         handle.write("Host: ");
26         handle.write(argv[3]);
27         handle.write("\r\n");
28     }
29     handle.write("\r\n");
30     unsigned size = 0;
31     senf::MicroTime offset = senf::now();
32     while (handle) {
33         size += handle.read().size();
34         std::cout << senf::now()-offset << " " << size << "\n";
35     }
36 }
37
38 ///////////////////////////////cc.e////////////////////////////////////////
39 #undef prefix_
40 //#include "testclient.mpp"
41
42 \f
43 // Local Variables:
44 // mode: c++
45 // End: