Danny,
In .NET 2.0, I believe the TcpClient exposes the underlying socket
through the Client property (it used to be protected, if I remember
correctly). Once you get the socket (by deriving from TcpClient in .NET 1.1
or through the public Client member in 2.0) you can call SetSocketOption,
passing in KeepAlive, to help manage keeping the socket alive.
Mind you, depending on the server (if you don't have control over it or
not), it might actually shut down the connection for some reason or another
(depending on the behavior it wants).
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Danny Tuppeny" <gr****@dannytuppeny.commmmmm> wrote in message
news:43***********************@ptn-nntp-reader02.plus.net...
Hi all,
I'm using a TcpClient to talk to a newserver. If I don't send any data for
a while, will the connection timeout, or does something in the TcpClient
keep it alive? If not, and it times out, how do I keep it alive without
actually sending data?
Thanks,