Commit d1c124b7 authored by Mark Moriarty's avatar Mark Moriarty

WIN32 rc-quiet fix, only do net_Accept once per second to avoid loading down CPU

parent c788b9a5
...@@ -392,9 +392,29 @@ static void Run( intf_thread_t *p_intf ) ...@@ -392,9 +392,29 @@ static void Run( intf_thread_t *p_intf )
if( p_intf->p_sys->i_socket_listen != - 1 && if( p_intf->p_sys->i_socket_listen != - 1 &&
p_intf->p_sys->i_socket == -1 ) p_intf->p_sys->i_socket == -1 )
{ {
#ifdef WIN32
/* If rc-quiet is specified, only check for socket connections
once per second, to not flood the CPU. */
if( config_GetInt( p_intf, "rc-quiet" ) )
{
do
{
p_intf->p_sys->i_socket =
net_Accept( p_intf, p_intf->p_sys->i_socket_listen, 0 );
msleep( 1000 );
} while ( p_intf->p_sys->i_socket == -1 );
}
else
{
p_intf->p_sys->i_socket = p_intf->p_sys->i_socket =
net_Accept( p_intf, p_intf->p_sys->i_socket_listen, 0 ); net_Accept( p_intf, p_intf->p_sys->i_socket_listen, 0 );
} }
#else
p_intf->p_sys->i_socket =
net_Accept( p_intf, p_intf->p_sys->i_socket_listen, 0 );
#endif
}
b_complete = ReadCommand( p_intf, p_buffer, &i_size ); b_complete = ReadCommand( p_intf, p_buffer, &i_size );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment