Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / August 2006

Tip: Looking for answers? Try searching our database.

understand KeepAlive issues on Socket programing in C#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
semedao - 21 Aug 2006 13:07 GMT
Hi,
I want to implement keepalive on connected socket between 2 machines , that
can be behind NAT.

I saw the
SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, 1)

and the IOControlCode.KeepAliveValues options.

But I didn't found article that explain how to use it.

1. both machines need to call those methods?

2. what the difference between the setsocketoption and the IOControl option
, and I need to use both , or only one of them ?

3. There is difference if I call those method before I connect the sockets
or after ?

4. there is difference if I am behind NAT ?

5. how to use the IOControl ? (syntak , values)

In general , there is good article about those issues ?

thanks a lot
Ignacio Machin ( .NET/ C# MVP ) - 21 Aug 2006 13:50 GMT
Hi,

> Hi,
> I want to implement keepalive on connected socket between 2 machines ,
> that can be behind NAT.

Why you want this?
I dont remember the last time I had to go so especific to establish a TCP
connection, 99.999% of the time you have enough by using TCPClient

> I saw the
> SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, 1)
>
> and the IOControlCode.KeepAliveValues options.
>
> But I didn't found article that explain how to use it.

My suggestion is to look into the unmanaged world. These options are not
used that often and you will find more info about it from Unix programming
(I think)

Signature

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.