[En-Nut-Discussion] Socket timeout

Harald Kipp harald.kipp at egnite.de
Sat Oct 12 18:05:21 CEST 2002


Yes, by default TCP may hang forever.

If TCP hangs in a receive and the remote died,
the receive will hang forever. In this case only
keepalive or a socket timeout will help. As
keepalive is not supported, only SO_RCVTIMEO
is available.

Best thing to do is to install Ethereal and see
what's going on.

Harald


At 11:50 12.10.02 -0400, you wrote:
>Hello, Harald,
>Please, explain, does 'no timeout' mean infinite waiting or immediate
>release? If I set timeout, will I eliminate possible infinite waiting loops
>or - vice a versa -  aggravate the situation. I'm sorry for such
>persistence, but I cannot verify it for sure, because sometimes the
>connection is good and sometimes it hangs without obvious reasons.
>Regards, Alex
>----- Original Message -----
>From: "Harald Kipp" <harald.kipp at egnite.de>
>To: <en-nut-discussion at egnite.de>
>Sent: Saturday, October 12, 2002 9:07 AM
>Subject: Re: [En-Nut-Discussion] Socket timeout
>
>
> > Alexander,
> >
> > By default there's no timeout. You need to call
> > NutTcpSetSockOpt() to set the timeout in
> > milliseconds. Here's an example for 5 sec timeout:
> >
> > u_long to = 5000;
> > if(NutTcpSetSockOpt(sock, SO_RCVTIMEO, &to, sizeof(to)))
> >      NutPrintString(0, "Sockopt TO failed\r\n");
> >
> > Harald
> >
> > _______________________________________________
> > En-Nut-Discussion mailing list
> > En-Nut-Discussion at egnite.de
> > http://www.egnite.de/mailman/listinfo/en-nut-discussion
>
>_______________________________________________
>En-Nut-Discussion mailing list
>En-Nut-Discussion at egnite.de
>http://www.egnite.de/mailman/listinfo/en-nut-discussion




More information about the En-Nut-Discussion mailing list