This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 13th, 2011  |  syntax: C++  |  size: 0.51 KB  |  views: 65  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include "server.h"
  2.  
  3. #include <cstdlib>
  4. #include <iostream>
  5. #include <boost/bind.hpp>
  6. #include <boost/asio.hpp>
  7.  
  8. using namespace std;
  9. using boost::asio::ip::tcp;
  10.  
  11.  
  12. int main(int argc, char* argv[])
  13. {
  14.         try
  15.         {
  16.                 if (argc != 2)
  17.                 {
  18.                         std::cerr << "Usage: ProxyServer <port>\n";
  19.                         return 1;
  20.                 }
  21.  
  22.                 boost::asio::io_service io_service;
  23.                 server s(io_service, atoi(argv[1]));
  24.                 io_service.run();
  25.         }
  26.         catch (std::exception& e)
  27.         {
  28.                 std::cerr << "Exception: " << e.what() << "\n";
  29.         }
  30.  
  31.         return 0;
  32. }
clone this paste RAW Paste Data