diff --git a/source/socket.cpp b/source/socket.cpp
index b16acb8..ed237d4 100644
--- a/source/socket.cpp
+++ b/source/socket.cpp
@@ -19,9 +19,10 @@
// along with this program. If not, see .
#include "socket.h"
-
#include "log.h"
+#include "platform.h"
+#include
#include
#include
#include
@@ -31,6 +32,8 @@
#include
#include
+using namespace std::chrono_literals;
+
///////////////////////////////////////////////////////////////////////////
Socket::~Socket ()
{
@@ -100,6 +103,7 @@ bool Socket::bind (SockAddr const &addr_)
case AF_INET:
if (::bind (m_fd, addr_, sizeof (struct sockaddr_in)) != 0)
{
+ platform::Thread::sleep (5000ms);
error ("bind: %s\n", std::strerror (errno));
return false;
}
@@ -110,6 +114,7 @@ bool Socket::bind (SockAddr const &addr_)
if (::bind (m_fd, addr_, sizeof (struct sockaddr_in6)) != 0)
{
error ("bind: %s\n", std::strerror (errno));
+ platform::Thread::sleep (5000ms);
return false;
}
break;