launching a socket server from asp.net

J

james b

Hi all,
We are currently putting together a web based application which needs
real time communication with the server. In order to achieve this we
are writing an application which will run as a socket server to
process and send out data, we have been planning to run this as a
service. Unfortuantly hosting companies won't run services without a
dedicated server, which is expensive.

Back when i was a java developer i wrote a jsp application which
launched a socket server in a seperate thread when the application
start event fired. This worked, but was never rolled out into a
production environment, so i don't know how reliable a solution it
would have been. My thoughts have turned to whether a similar solution
would work in asp.net, as this should allow us to run our socket
server without needing a dedicated server. Does anyone have experience
of doing this in ASP.NET? Are there any obvious gotcha's, maybe
relating to security, performance, something else?

Your help will be much appreciated

thanks

James
 
M

Manohar Kamath [MVP]

James,

For one, you can not program sockets using ASP.NET, but can do with .NET
using system.net.sockets namespace. The following article has a simple
client/server program using sockets.

http://www.developerfusion.com/show/3918/

The constraint, I am assuming, needs to listen on a port. So, as long as the
hosting company lets you do this, so you don't block their ports, it is
quite possible with .NET.
 
B

bruce barker

you can start a backgound thread on appstartup. you will need a primer in
case iis is recycled, or your appdomain is recycled. also check that you
host isp hasn't blocked the port you want to use.

-- bruce (sqlwork.com)
 
K

Kevin Spencer

Why not use Web Services?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
J

james bridger

Kevin,
I was under the impression that web services are still based around the
request/response model, as they run over http.

What i need is the ability to push messages to a client - for example a
user may connect to the server, then receive a response every few
seconds for the next couple of hours.

Are web services capable of this? If they are what would be the benefits
of using them in this situation?

thanks

James
 
J

james bridger

Hi Bruce,
This sounds like the sort of thing i'm looking for.

I'm not sure what you mean by a "primer" if iis or the appdomain are
recycled. Could you expand on this, or point me towards some relevant
documentation

thanks

James
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top