Guest User

Untitled

a guest
Jun 24th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. boost::asio::io_service _ioService;
  2. boost::asio::ip::tcp::socket _socket(_ioService);
  3.  
  4. boost::system::error_code err;
  5. _socket.open(boost::asio::ip::tcp::v4(), err);
  6.  
  7. _socket.bind(boost::asio::ip::tcp::endpoint(boost::asio::ip::address_v4::from_string("127.0.0.1"), 1250), err);
  8.  
  9.  
  10. if (err.value())
  11. {
  12. cout << err.value() << endl;
  13. cout << err.message() << endl;
  14. }
  15.  
  16. _socket.connect(boost::asio::ip::tcp::endpoint(boost::asio::ip::address_v4::from_string("127.0.0.1"), 1500), err);
  17.  
  18. //_socket.shutdown(_socket.shutdown_both);
  19. //_socket.close(err);
Add Comment
Please, Sign In to add comment