473,388 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Always-on socket connection?

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!
Nov 16 '05 #1
1 1324
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.

--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"Noah" <no****@cyberdude.com> wrote in message
news:31****************************@phx.gbl...
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!

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: Teis Draiby | last post by:
In .NET, can I be sure that the result of a division between two integers always is truncated rather that rounded to nearest? Example: 99 / 50 = 1 regards, Teis
2
by: db2group88 | last post by:
i would like to know when i create a table with identity column, should i used generated by default or generated as always. since when i create this table, i might copy some data from another table...
8
by: yuri | last post by:
Hi all At coding XP Themes i can't get "GetThemeColor" to work. It always fails ("not found" err. code) regardless of which control parts and states entered. Could somebody help me with advice?...
3
by: cody | last post by:
why foreach does always have to declare a new variable? I have to write foreach (int n in array){} but Iam not allowed to write: int n=0; foreach (n in array){}
3
by: r.manders | last post by:
In visual Studio .Net when I start a program in the debugger, it always starts building all included project files. This only happens since a few weeks, before that it just started the program,...
2
by: gjtired | last post by:
Hi, I can't figure out why my HasRows code is always true. Below is a snippet of my code. sqlConnection1.Open(); //Check that quiz name is not a duplicate during the Create(0)task string...
8
by: JSheble | last post by:
I'm writing some code that interacts with MSMQ, and am getting in the habit of using try{}catch{}finally{} blocks, but am now running into a problem with un-initialized variables... for example,...
8
by: Peter | last post by:
Hi, there I have created an stored procedure using the DDL below for my MS Access Database and no error occurs. Also it can create an stored procedure if I changed the parameter from "" to...
30
by: Brian | last post by:
I am using Borland C++ Builder 5 for my application. When I build my application, it states that I have several if-statements that will always be false. The statements appear correct, so could...
11
by: active | last post by:
The code below does much as expected. For example biSize=40 but biClrUsed is always zero!
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.