Re: what does SocketOptionName.KeepAlive mean?



"In practice, however, a Socket connection will be closed long before that
2 hour period >if no data is sent within that interval."

Why so Dave? I have never seen that happen.

"Dave Sexton" <dave@jwa[remove.this]online.com> wrote in message
news:uIYBNuOqGHA.3816@xxxxxxxxxxxxxxxxxxxxxxx
Hi Ryan,

SocketOptionName.KeepAlive must be associated with a TCP Socket and
supplied as a Boolean value, true or false, to the SetSocketOption method.

See section 4.2.3.6 TCP Keep-Alives of RFC 1122 for the standardized
design:

http://www.faqs.org/rfcs/rfc1122.html

In short, enabling keep-alives causes a packet to be sent every 2 hours,
by default, to keep the connection alive when there has been no data sent
by the application within that 2 hour period. In practice, however, a
Socket connection will be closed long before that 2 hour period if no data
is sent within that interval.

- David Sexton

"Ryan Liu" <ad50275324@xxxxxxxxxxxx> wrote in message
news:O0uMqgLqGHA.2304@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

SocketOptionName.KeepAlive is a bool or an int value?

Is it "belongs to" SocketOptionLevel.Socket?

What does value 0 means? Is that meaning always "keep alive", or never
"send
keep-alives"?

And what does "Send keep-alives" mean anyway?

Thanks a million?
Ryan






.



Relevant Pages

  • Re: Notification when network connection loss...
    ... For sends the tcp stack will retry sending the data 5 times by default. ... This value controls how often TCP attempts to verify that an idle connection ... Keep-alive packets are not sent by default. ... TCP keep-alives can be sent once every ...
    (microsoft.public.windowsce.app.development)
  • Re: Should a socket client detect loss of network connection
    ... Implementors MAY include "keep-alives" in their TCP ... erroneous TCP implementations. ... I have written a socket client and a server. ...
    (microsoft.public.win32.programmer.networks)
  • Re: NAT and keepaliveopen connection over TCP
    ... Implementors MAY include "keep-alives" in their TCP ... There's no minimum set time how long a NAT router should ... time-out inactive connections at the server. ...
    (microsoft.public.win32.programmer.networks)
  • Re: sysctl_tcp_keepalive_time
    ... Implementors MAY include "keep-alives" in their TCP ... Keep-alive packets MUST only be sent when no data or ...
    (Linux-Kernel)
  • Re: what does SocketOptionName.KeepAlive mean?
    ... SocketOptionName.KeepAlive must be associated with a TCP Socket and supplied ... as a Boolean value, true or false, to the SetSocketOption method. ... In short, enabling keep-alives causes a packet to be sent every 2 hours, by ...
    (microsoft.public.dotnet.languages.csharp)