const char on = 1;
int iResult = setsockopt(udp_socket, SOL_SOCKET, SO_REUSEADDR, &on,
sizeof(on));
if (iResult != NO_ERROR)
{
std::cerr << "Can not enable REUSEADDR mode."
<< " Error code: " << iResult << "\n";
closesocket(udp_socket);
return INVALID_SOCKET;
}