make outbound port configurable on runtime

pull/305/head
Jeff Becker 5 years ago
parent 555711b70d
commit 24de7f052a
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -734,7 +734,11 @@ namespace llarp
if(StrEq(section, "bind"))
{
if(!StrEq(key, "*"))
if(StrEq(key, "*"))
{
m_OutboundPort = proto;
}
else
{
auto server = llarp::utp::NewServerFromRouter(this);
if(!server->EnsureKeys(transport_keyfile.string().c_str()))
@ -1676,7 +1680,7 @@ namespace llarp
for(auto af : afs)
{
if(!link->Configure(netloop, "*", af, 0))
if(!link->Configure(netloop, "*", af, m_OutboundPort))
continue;
outboundLinks.insert(std::move(link));
break;

@ -209,6 +209,8 @@ namespace llarp
// buffer for serializing link messages
std::array< byte_t, MAX_LINK_MSG_SIZE > linkmsg_buffer;
uint16_t m_OutboundPort = 0;
/// always maintain this many connections to other routers
size_t minConnectedRouters = 1;
/// hard upperbound limit on the number of router to router connections

Loading…
Cancel
Save