mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-21 16:49:10 +01:00
[ssu2] close socket if it was opened on OpenSocket
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
parent
97b7ea0da5
commit
3c65012a63
1 changed files with 7 additions and 5 deletions
|
@ -212,6 +212,8 @@ namespace transport
|
||||||
boost::asio::ip::udp::socket& socket = localEndpoint.address ().is_v6 () ? m_SocketV6 : m_SocketV4;
|
boost::asio::ip::udp::socket& socket = localEndpoint.address ().is_v6 () ? m_SocketV6 : m_SocketV4;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if (socket.is_open ())
|
||||||
|
socket.close ();
|
||||||
socket.open (localEndpoint.protocol ());
|
socket.open (localEndpoint.protocol ());
|
||||||
if (localEndpoint.address ().is_v6 ())
|
if (localEndpoint.address ().is_v6 ())
|
||||||
socket.set_option (boost::asio::ip::v6_only (true));
|
socket.set_option (boost::asio::ip::v6_only (true));
|
||||||
|
|
Loading…
Add table
Reference in a new issue