RE: Web Services or Sockets?
- From: Joe <Joe@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 19 Apr 2005 08:39:02 -0700
Thanks Dan!
As far as opening ports on the firewall, I am talking about users in
different companies with addresses from a DHCP server. That's another reason
I would rather not use sockets. I guess we could use some kind of VPN, but I
don't know if the customer would go for that. I would still like to know how
an instant messenger program works. Is it streaming over sockets? Or does
it listen to a port on the client computer?
"Dan Kelley" wrote:
> Whether polling is unacceptable is impossible to say. It depends on how often
> polling occurs, with how many clients, how much data, and what kind of
> connection. You would need to stress test a few alternative solutions to find
> this out.
>
> As for firewalls, you would obviously need to open an approrpiate port for
> your messages to get through. An alternative, if you wish all traffic to go
> through port 80 maybe the HttpWebRequest class, although I have to be honest
> I have never used this before.
>
> I am not saying polling is wrong. As always - it depends. But hopefully you
> have a few more options to consider now.
>
> HTH
> Dan
>
> "Joe" wrote:
>
> > Thanks for your responses...
> >
> > Again, I don't know how these two examples with clients over the internet.
> > If the client is listening to a port, but is sitting behind a firewall, how
> > will the server contact it? How do instant messengers work? I doubt that
> > they constantly poll, but you can use them on phone and mobile devices. Is
> > this polling method unacceptable?
> >
> >
> > "Dan Kelley" wrote:
> >
> > > The alternative to the "pull" architecture you have suggested is a "push"
> > > architecture, whereby the server is responsible for notifying clients of
> > > events.
> > >
> > > In this scenario, each client would need to register their interest in
> > > receiving a notification from the server. They would then need to provide a
> > > way of allowing the sever to contact them - perhaps exposing a remoted object
> > > or listen on a socket for incoming notifications.
> > >
> > > The server would then need to iterate over this loop, contacting each client
> > > in turn. There are a few difficulties with this method. One is how to handle
> > > uncontactable clients. Another is how quickly can the server notify a large
> > > number of clients. If you use the thread pool to notify clients, you risk
> > > creating a deadlock situation due to thread pool starvation. Too many
> > > threads, and your CPU spends lots of time context switching.
> > >
> > > I personally have started implenting a UDP mutlicast solution to notify a
> > > large number of clients, although my situation is somewhat simpler as I am
> > > contacting clients who are on an internal network, and so am in control of
> > > router configuration, etc.
> > >
> > > HTH
> > > Dan
> > >
> > > "Joe" wrote:
> > >
> > > > I am looking to create a Windows Forms application that would get
> > > > notifications from the server when data changes or it gets an instant message
> > > > from other users. This application would have to work at different sites
> > > > over the internet. The two technologies I am looking at are Web Services or
> > > > Sockets. Would it be okay to have a client (lets say 500 clients) poll a web
> > > > service every 5 seconds for messages? The messages will be stored in a MSMQ
> > > > queue on the server and returned to the client through the web service
> > > > call. This is the direction I would like to go for several reasons. Reason
> > > > one; I don’t have to worry about the socket programming. Reason two is that
> > > > some of the clients might be mobile going in and out of coverage breaking the
> > > > socket connection.
> > > >
> > > > So my question is will polling the service be too much network traffic?
> > > > Does polling a web service utilize more server recourses then streaming
> > > > sockets? I am thinking it will, but I am hoping somebody will tell me
> > > > otherwise!
> > > >
> > > > Thanks for any help or information!
> > > >
.
- Follow-Ups:
- Re: Web Services or Sockets?
- From: richlm
- Re: Web Services or Sockets?
- References:
- Web Services or Sockets?
- From: Joe
- RE: Web Services or Sockets?
- From: Dan Kelley
- RE: Web Services or Sockets?
- From: Joe
- RE: Web Services or Sockets?
- From: Dan Kelley
- Web Services or Sockets?
- Prev by Date: RE: Web Services or Sockets?
- Next by Date: Re: Web Services or Sockets?
- Previous by thread: RE: Web Services or Sockets?
- Next by thread: Re: Web Services or Sockets?
- Index(es):
Relevant Pages
|