Boost logo

Boost Users :

Subject: Re: [Boost-users] choosing source ip on multihomed computer (Bjorn Reese)
From: David Frank (david_frank56_at_[hidden])
Date: 2014-09-30 21:05:44


                
I did, here is my relevant code segment, but the destination still shows that I sent from another ip than what I set here:

tcp::resolver resolver(fIo_service);
                tcp::resolver::query query(tcp::v4(), host, port);
                tcp::resolver::iterator iterator = resolver.resolve(query);
                fpSocket = new tcp::socket(fIo_service);
                if (fpSocket == nullptr)
                        return ;
                fpSocket->open(boost::asio::ip::tcp::v4());
                fpSocket->bind(boost::asio::ip::tcp::endpoint(boost::asio::ip::address::from_string("<ip>"), 0));
                boost::system::error_code errcode;
                boost::asio::connect(*fpSocket, iterator, errcode);
 

On Tuesday, September 30, 2014 12:00 PM, "boost-users-request_at_[hidden]" <boost-users-request_at_[hidden]> wrote:
  

Send Boost-users mailing list submissions to
    boost-users_at_[hidden]

To subscribe or unsubscribe via the World Wide Web, visit
    http://lists.boost.org/mailman/listinfo.cgi/boost-users
or, via email, send a message with subject or body 'help' to
    boost-users-request_at_[hidden]

You can reach the person managing the list at
    boost-users-owner_at_[hidden]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Boost-users digest..."

Today's Topics:

   1. Re: choosing source ip on multihomed computer (Bjorn Reese)
   2. Re: [Threads] and OpenMP (Bjorn Reese)

----------------------------------------------------------------------

Message: 1
Date: Tue, 30 Sep 2014 15:58:37 +0200
From: Bjorn Reese <breese_at_[hidden]>
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] choosing source ip on multihomed computer
Message-ID: <542AB70D.6060807_at_[hidden]>
Content-Type: text/plain; charset=windows-1252; format=flowed

On 09/30/2014 03:04 PM, David Frank wrote:

> I'm wondering how to make boost::asio::connect(<socket>, ...)
> connect from the source interface/ip address I choose on a multihomed
> computer.

Call bind() before connect().

------------------------------

Message: 2
Date: Tue, 30 Sep 2014 15:59:43 +0200
From: Bjorn Reese <breese_at_[hidden]>
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] [Threads] and OpenMP
Message-ID: <542AB74F.4010303_at_[hidden]>
Content-Type: text/plain; charset=windows-1252; format=flowed

On 09/30/2014 11:24 AM, Stephan Menzel wrote:

> So the question is: How can I more or less gracefully shut this down?
> How do interruption points work in an omp parallel for loop? Do I have a
> chance at all?

One approach is to execute the tasks in a separate process. The process
can easily be killed, and it takes care of the memory leaks.

------------------------------

Subject: Digest Footer

_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users

------------------------------

End of Boost-users Digest, Vol 3932, Issue 2
********************************************



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net