Re: Timeout on Async Receive



Yes, that's exactly what I do here: http://www.lenholgate.com/archives/000306.html

On Sep 30, 12:56 am, "Sam Hobbs"
<sam...@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I realize that this problem is probably solved already, but if I understand
the question then an alternative that also uses a single timer is to set a
timer for just the duration until the most recent timeout will occur. Then
it would be a matter of keeping the list sorted and of rescheduling the
timer when it either expires or the current timeout becomes unneeded.

"Alexander Nickolov" <agnicko...@xxxxxxxx> wrote in message

news:OBU$tYU%23HHA.2752@xxxxxxxxxxxxxxxxxxxxxxx



A single timer should suffice. I don't suppose you care much
for time accuracy... Have your timer execute every second and
check all sockets.

BTW, IOCP cannot be used with async I/O, perhaps you meant
overlapped I/O...

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnicko...@xxxxxxxx
MVP VC FAQ:http://vcfaq.mvps.org
=====================================

"Kürþat" <x...@xxxxxx> wrote in message
news:e9RWxeS%23HHA.1484@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

I implemented a socket server by using IOCP and Async IO. The server
sends commands to connected clients and waits response from them. Now I
want to build a timeout mechanism for commands. If a client does not
respond along timeout period I should take some action for that client.
What is the best way to implement that? Should I start a timer for all
commands? Client count is about 3000-10000 so large number of timers may
be activated at a given time, what about this?

Thanks in advance.- Hide quoted text -

- Show quoted text -


.



Relevant Pages

  • Re: Timeout on Async Receive
    ... On Sep 30, 12:56 am, "Sam Hobbs" ... timer for just the duration until the most recent timeout will occur. ... respond along timeout period I should take some action for that client. ...
    (microsoft.public.win32.programmer.networks)
  • Re: Timeout on Async Receive
    ... Then I assume you did mention that in your previous response and I just did ... timer for just the duration until the most recent timeout will occur. ... respond along timeout period I should take some action for that client. ...
    (microsoft.public.win32.programmer.networks)
  • Re: Timeout on Async Receive
    ... timer for just the duration until the most recent timeout will occur. ... sends commands to connected clients and waits response from them. ... respond along timeout period I should take some action for that client. ...
    (microsoft.public.win32.programmer.networks)
  • Timeout on Async Receive
    ... I implemented a socket server by using IOCP and Async IO. ... commands to connected clients and waits response from them. ... timeout period I should take some action for that client. ... Should I start a timer for all commands? ...
    (microsoft.public.win32.programmer.networks)
  • Notifying client before session timeout
    ... How can I notify the client that their session is about to timeout? ... I've placed a timer into global.asax, but this, for example, doesn't work ...
    (microsoft.public.dotnet.framework.aspnet)