Skip to content

HttpClientSession does not allow specification of local port address. #411

@dedvalson

Description

@dedvalson

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions