Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

boost asio - connect using an ip address

Tags:

boost-asio

I want to connect to a server socket specified by a destination ip address and port number.

boost::asio::connect seems it does not allow to use this. I have ip destination as a unsigned int value.

Update: I am able to do

ba::ip::tcp::endpoint endpoint( ba::ip::address(ba::ip::address_v4(req.IpDst())), ntohs(req.Port()));

But how can I use endpoint with connect ?

like image 771
Ghita Avatar asked Jan 27 '12 21:01

Ghita


1 Answers

It is possible to use:

socket.connect(endpoint);
like image 200
Ghita Avatar answered Nov 01 '22 04:11

Ghita