Jump to content

Push technology chat application

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
totonex

totonex

    Learning Programmer

  • Members
  • PipPipPip
  • 82 posts
Hello everyone,
I need some advice.

I have been given an assignment to construct some kind of chat application which uses push technology (In C#, but that's not the matter right now).
Reading on the internet, i came to know that push technology means in essence, that not the client makes requests, but the server updates content when 'it thinks it's appropriate' (mostly on a time-based schedule, or as soon as new data arrives).
Now i need a few ideas an hints, from you guys who are more knowledgeable in this domain.
My main questions arise here:
If a client logs in, and starts chatting with another one, a regular messenger client would open a connection to the other client, essentially making it a Peer2Peer mini-application, with no server interference. The only actual role of the server would be to update the list of contacts as they 'log in' and 'log out'.
Is this particular implementation good? How do other messenger-chat-apps work? Shouldn't the information pass through the server? If the server's only role is to announce who is 'logged in' and 'logged off', then why bother implementing push technology? (I've been given the assignment, with the words 'push technology' stressed out).

Looking forward to hearing your answers,
Thank you.

#2
deskchecked

deskchecked

    Newbie

  • Members
  • PipPip
  • 29 posts
Either approach is fine, neither is more correct than the other -- just different. It's up to you to decide which is appropriate (assuming the assignment doesn't indicate otherwise).

Push is just a fuzzy new name for the "opposite" of polling. In a polling application, the client would continuously ask the server (or the peer it's chatting to) whether new information was available and the server would either respond with the new data or indicate that no new data was available.

In push, the client simply connects to the server/peer and waits for notifications of new events (e.g. "bob has logged off", "bert said 'hi'") which the server sends without having to be asked continuously.

If you're talking ASP.NET, this might be more complicated since you'll need to fiddle with HTTP responses to ensure that the connection between the client and the server doesn't close (otherwise, you'd effectively be implementing a polling solution). I don't know enough about ASP.NET to say exactly how, but hopefully this is enough for you to run with. :)