������� ������, ����������� ����������, ���������� � ����� select.
��� ��������� ���� timeval.tv_sec ��������� � 0
��� ����������� �� ���� timeval.tv_usec
(�������� �������� ���� 400, 500, 900, 999)
���������� �������� (������� 90-95%) �������� ����������.
��������, �������� ������ ����������� �
select ���������� ���������� � �����.
� win2000 � ���� ��������� ������� �� ��������.
��� ����� �����������, ���� ������ ����� ��������
����� 1 ������� � windows98?
��������:
{
fd_set set;
struct timeval timeout;
// ...
/* Initialize the timeout data structure. */
timeout.tv_sec = 1;//seconds;
timeout.tv_usec = 0;
write_log(hwnd_mess,0,"������� ������: ������ ����������",0,0);
/* select returns 0 if timeout, 1 if input available, -1 if error. */
rc_server_thread_active=1;
while(!rc_server_thread_quit)
{
/* Initialize the file descriptor set. */
FD_ZERO (&set);
FD_SET (rc_sock, &set);
if(select (FD_SETSIZE,&set,0,0,&timeout) )
{
// �������� �� �������� ������ ����������
//...
}
for (i=0;i<rc_clients_count;i++)
{
// ��� ��� ��������� �������� �� ������ ����� �������������� �������
// ...
}
}
}
����