Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

No way to bind UDPCL to a specific source port #56

@BrianSipos

Description

@BrianSipos

The current outduct_element_config_t has a way to ensure a specific LTP local port with ltpSenderBoundPort but there is no way to do the equivalent thing with the outgoing UDP source port.

The current behavior uses a fixed bind port of "0" (meaning choose an ephemeral port) here

m_udpSocket.bind(boost::asio::ip::udp::endpoint(boost::asio::ip::udp::v4(), 0)); //bind to 0 (random ephemeral port)

but this could be made a configuration from e.g. an option udpSenderBoundPort.

Additionally, the current open() and bind() within UdpBundleSource::OnResolve() doesn't actually need to wait for the peer address resolution. Both open and bind can happen (and catch errros) in that class constructor.

If source port selection is allowed, the following should be enabled just before the bind() call to enable multiple sockets to use the same sort port

m_udpSocket.set_option(boost::asio::socket_base::reuse_address(true));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions