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

Property handling of WSARecvFrom returns 10054(WSAECONNRESET)?

65 views
Skip to first unread message

imays

unread,
Sep 25, 2009, 2:10:35 AM9/25/09
to
I heard that overlapped I/O'ed WSARecvFrom may return 10054
(WSAECONNRESET) if the prior sending packet to the unreachable host
failed and ICMP packet 'host unreachable' is received. If this occurs,
what is the best handling of this case?

As far as I know, I used this scheme:

WSARecvFrom();
if(it returns 10054) retry WSARecvFrom() until it doesn't return
10054 anymore

Is this safe?
Any replies are welcomed. Thanks in advance.

Hyun-jik Bae

David Schwartz

unread,
Nov 10, 2009, 11:30:42 PM11/10/09
to
On Sep 24, 10:10 pm, imays <imay...@gmail.com> wrote:

> I heard that overlapped I/O'ed WSARecvFrom may return 10054
> (WSAECONNRESET) if the prior sending packet to the unreachable host
> failed and ICMP packet 'host unreachable' is received. If this occurs,
> what is the best handling of this case?

Are we talking about UDP here?

> As far as I know, I used this scheme:
>
>    WSARecvFrom();
>    if(it returns 10054) retry WSARecvFrom() until it doesn't return
> 10054 anymore
>
> Is this safe?
> Any replies are welcomed. Thanks in advance.

The meaning of the error code depends massively on the underlying
protocol. For example, this is obviously not safe with TCP -- you'll
likely loop forever.

DS

0 new messages