src/libtsduck/base/network/tsUDPSocket.cpp
bool ts::UDPSocket::bind(const SocketAddress& addr, Report& report)
{
    ::sockaddr sock_addr;
    addr.copy(sock_addr);

    report.debug(u"binding socket to %s", {addr});
    if (::bind(getSocket(), &sock_addr, sizeof(sock_addr)) != 0) {
        report.error(u"error binding socket to local address: %s", {SocketErrorCodeMessage()});
        return false;
    }

    // Keep a cached value of the bound local address.
    return getLocalAddress(_local_address, report);
}
//----------------------------------------------------------------------------
// Bind to a local address and port.
// Return true on success, false on error.
//----------------------------------------------------------------------------
Bind to a local address and port.
Return true on success, false on error.
Bind to a local address and port . Return true on success false on error .
bool ts::UDPSocket::bind(const SocketAddress& addr, Report& report)
{
    ::sockaddr sock_addr;
    addr.copy(sock_addr);
    report.debug(u"binding socket to %s", {addr});
    if (::bind(getSocket(), &sock_addr, sizeof(sock_addr)) != 0) {
        report.error(u"error binding socket to local address: %s", {SocketErrorCodeMessage()});
        return false;
    }
    return getLocalAddress(_local_address, report);
}
bool ts :: UDPSocket :: bind ( const SocketAddress & addr , Report & report ) { :: sockaddr sock_addr ; addr . copy ( sock_addr ) ; report . debug ( u" " , { addr } ) ; if ( :: bind ( getSocket ( ) , & sock_addr , sizeof ( sock_addr ) ) != 0 ) { report . error ( u" " , { SocketErrorCodeMessage ( ) } ) ; return false ; } return getLocalAddress ( _local_address , report ) ; }
Bind to a local address and port.
Bind to a local address and port .
// Keep a cached value of the bound local address.