Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

timeval at windows98

0 views
Skip to first unread message

Ilya Lushcheev

unread,
Oct 1, 2009, 11:59:14 PM10/1/09
to
Hello, All!

������� ������, ����������� ����������, ���������� � ����� 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++)
{
// ��� ��� ��������� �������� �� ������ ����� �������������� �������

// ...

}

}

}
����

0 new messages