-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
Description
There is no combination of Constructors or Functions that allow the creation of an HttpClientSession specifying the local address. I tried the following:
StreamSocket s; // create the socket manually
SocketImpl *si = s.impl();
si->bind (LocalAddress); // bind it
HTTPClientSession hs (s); // create the session using the socket
hs.setHost(RemoteServer); // try to set the remote server - FAILS
hs.setPort(RemotePort);
The SetHost call fails because it thinks the socket is already connected, even though it isn't really. The Connected() function checks to see if the socket is initialized, not whether or not it is connected.
I think what is needed is a member function like the following:
void setLocalHost(
const std::string & host
); // specify the local network interface to use for this connection.
Probably this should exist at the HttpSession level.
Reactions are currently unavailable