Always-on socket connection?

  • Thread starter Thread starter Noah
  • Start date Start date
N

Noah

Hello guys,

I'm trying to create a relay server in C#. The client
will connect to the relay server and I want this
connection to stay open forever if possible. Then when a
visitor connects to the relay server, it will relay the
request to the client who's response will be relayed back
to the visitor.

I've gotten this to work when things are just started
but if I let it run all night the sockets will close or
error by themselves. Is there any way to get them to just
stay open forever? Ping them every x minutes?

Thanks!
 
SetSocketOption()... and SocketOptionName.KeepAlive...

They may or may not help you depending on your hardware. Keep alive tends to
be fairly lazy, and all three participants in the conversation you are having
can shut
down their portions of the sockets.
 
Back
Top