Opening and Closing Sockets

G

Guest

Hi,

I am writing an app that will have a socket server to listen for and process
data from 20+ clients. These clients will send data aproximately every
400-500ms.

I was wondering if it is possible when i have established a connection with
a client to keep that connection open rather than opening and closing every
400-500ms as i'd imagine there is overhead involved in this.

Is this possible?

Thanks In Advance
Macca
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Macca said:
Hi,

I am writing an app that will have a socket server to listen for and
process
data from 20+ clients. These clients will send data aproximately every
400-500ms.

I was wondering if it is possible when i have established a connection
with
a client to keep that connection open rather than opening and closing
every
400-500ms as i'd imagine there is overhead involved in this.

Is this possible?

It's possible IF the client does the same thing. if the client close the
connection you will receive a new connection request anyway
 
C

C.C. \(aka Me\)

Just adding a bit to this.

Keep in mind that both client and server need to establish a "common ground"
or "common set of rules" that they will both obey. If you want the server
side to use a persistant type of connection then the client must also
implement it. If the client is a 3rd party (ie. not your code) then you
will have to code your server to whatever "rules" the client has.. and the
same is true if the server code is not yours - you will have to code your
client to whatever "rules" the server has.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top