src/net.cpp
static CAddress GetBindAddress(SOCKET sock)
{
    CAddress addr_bind;
    struct sockaddr_storage sockaddr_bind;
    socklen_t sockaddr_bind_len = sizeof(sockaddr_bind);
    if (sock != INVALID_SOCKET) {
        if (!getsockname(sock, (struct sockaddr*)&sockaddr_bind, &sockaddr_bind_len)) {
            addr_bind.SetSockAddr((const struct sockaddr*)&sockaddr_bind);
        } else {
            LogPrint(BCLog::NET, "Warning: getsockname failed\n");
        }
    }
    return addr_bind;
}
/** Get the bind address for a socket as CAddress */
Get the bind address for a socket as CAddress
Get the bind address for a socket as CAddress
static CAddress GetBindAddress(SOCKET sock)
{
    CAddress addr_bind;
    struct sockaddr_storage sockaddr_bind;
    socklen_t sockaddr_bind_len = sizeof(sockaddr_bind);
    if (sock != INVALID_SOCKET) {
        if (!getsockname(sock, (struct sockaddr*)&sockaddr_bind, &sockaddr_bind_len)) {
            addr_bind.SetSockAddr((const struct sockaddr*)&sockaddr_bind);
        } else {
            LogPrint(BCLog::NET, "Warning: getsockname failed\n");
        }
    }
    return addr_bind;
}
static CAddress GetBindAddress ( SOCKET sock ) { CAddress addr_bind ; struct sockaddr_storage sockaddr_bind ; socklen_t sockaddr_bind_len = sizeof ( sockaddr_bind ) ; if ( sock != INVALID_SOCKET ) { if ( ! getsockname ( sock , ( struct sockaddr * ) & sockaddr_bind , & sockaddr_bind_len ) ) { addr_bind . SetSockAddr ( ( const struct sockaddr * ) & sockaddr_bind ) ; } else { LogPrint ( BCLog :: NET , " \n " ) ; } } return addr_bind ; }
Get the bind address for a socket as CAddress
Get the bind address for a socket as CAddress