listen port tweak

This commit is contained in:
Marcos Pinto 2007-09-10 17:15:48 +00:00
parent dcf3cac453
commit c2b9a5eaaa
1 changed files with 3 additions and 2 deletions

View File

@ -667,13 +667,13 @@ namespace detail
{
// create listener socket
m_listen_socket.reset(new socket_acceptor(m_io_service));
m_listen_socket->set_option(socket_acceptor::reuse_address(true));
for(;;)
{
try
{
m_listen_socket->open(m_listen_interface.protocol());
m_listen_socket->set_option(socket_acceptor::reuse_address(true));
m_listen_socket->bind(m_listen_interface);
m_listen_socket->listen();
m_external_listen_port = m_listen_interface.port();
@ -2380,3 +2380,4 @@ namespace detail
}
}}