[windows] add binding exceptions messagebox notifications, update exceptions handling code

Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
R4SAS 2020-05-05 02:36:34 +03:00
parent d991cc3b96
commit 42d4781a96
No known key found for this signature in database
GPG key ID: 66F6C87B98EBCFE2
9 changed files with 160 additions and 97 deletions

View file

@ -1195,7 +1195,10 @@ namespace transport
}
catch ( std::exception & ex )
{
LogPrint(eLogError, "NTCP2: Failed to bind to v4 port ",address->port, ex.what());
LogPrint(eLogError, "NTCP2: Failed to bind to v4 port ", address->port, ex.what());
#ifdef WIN32_APP
ShowMessageBox (eLogError, "Unable to start IPv4 NTCP2 transport at port ", address->port, ": ", ex.what ());
#endif
continue;
}
@ -1218,7 +1221,10 @@ namespace transport
auto conn = std::make_shared<NTCP2Session> (*this);
m_NTCP2V6Acceptor->async_accept(conn->GetSocket (), std::bind (&NTCP2Server::HandleAcceptV6, this, conn, std::placeholders::_1));
} catch ( std::exception & ex ) {
LogPrint(eLogError, "NTCP2: failed to bind to v6 port ", address->port);
LogPrint(eLogError, "NTCP2: failed to bind to v6 port ", address->port, ": ", ex.what());
#ifdef WIN32_APP
ShowMessageBox (eLogError, "Unable to start IPv6 NTCP2 transport at port ", address->port, ": ", ex.what ());
#endif
continue;
}
}