-2

I am a an amateur in Vb.NET programming, or in this case any programming language that needs push server notification.

I am currently making an application which requires the server to send a notification if Client A is making a task assigned to Client B.

I can only imagine to create another application on the server which up all the time and listens to any changes happening on the database, and then if there any changes send a notification to assigned user.

Is there any better approach?

Can someone point me to a good resource?

Any help will be greatly appreciated.

Thank you.

Samuel Adam
  • 1,327
  • 4
  • 26
  • 45
  • 1
    Look at AJAX. Every 10 seconds call an ASP.net page with AJAX with the users ID, that checks the database for tasks assigned to this user. If task is found, show the response in a status bar of sorts. – TheCarver Jul 28 '12 at 08:45
  • @PaparazzoKid Sorry I don't quite understand, but isn't that kind of using timer? What I look for is a method to make the server actively send notification.. – Samuel Adam Jul 28 '12 at 16:15
  • Yes, that's using a timer. I assumed that would be sufficient for you, as you mentioned being an amateur and what you are asking for is fairly advanced. I have no idea about push notifications, sorry. One of my website uses a notification service, which acts just like a live push service, but I built it on AJAX with a timer. – TheCarver Jul 28 '12 at 16:26
  • This could help: http://www.codeproject.com/Articles/154345/Wcf-Client-Server-Push-using-MSMQ – TheCarver Jul 28 '12 at 16:27
  • 1
    and this: http://stackoverflow.com/questions/471780/asp-net-http-server-push-to-client – TheCarver Jul 28 '12 at 16:28
  • 2
    I'm downvoting because your question shows a lack of research, I'm mean, I know. Searching Stack Overlow's previously answered questions, and Google, would give you all the answers you need. As @PaparazzoKid mentions, AJAX is the best way to go unless you're using mobile apps or apps, see this question: http://stackoverflow.com/questions/1081018/push-notifications-in-asp-net. Every 2-3 seconds, call the server to check updates/tasks, then fire a notification back to the webpage. Research AJAX and Reverse AJAX. – ShadowStorm Jul 28 '12 at 16:54
  • 2
    You could even create a Windows Scheduled Task to call a page every 30 seconds, check the database for new updates/tasks, notify the person involved. This way, it doesn't even need a webpage to be open to work. – TheCarver Jul 28 '12 at 17:00
  • What scenario do you have? Do you want to push notifications to a mobile app, a desktop app or a website? If website, do you realize that Facebook uses AJAX/POST requests to show you that somebody has messaged you or that somebody has liked a comment or post - by adding a [1] to the status bar and popping up a little message "PaparazzoKid has sent you a message.". Even on a chat room website, they use AJAX to tell if the other user is typing a message and to asynchronously load it when they've sent it. – TheCarver Jul 28 '12 at 18:01
  • Thank you guys for the resources ! More than a big help ! – Samuel Adam Jul 30 '12 at 03:20

1 Answers1

1

This has been covered already here [asp.net http server push to client], which should give you some good info about adding a push service to your project.

On a related question, John Saunders, says:

"Unfortunately, that's just not the way the web is designed. Rather, it's set up so that a user asks for a specific resource and the web server provides it if it can. One request always returns exactly one response.

This means that you need to simulate the push service by creating a heartbeat between a rendered browser page and your server. The web page will have javascript that tells the browser to periodically ask the server, "Do you have any changes for me?" You can implement that in ASP.Net AJAX using the timer control, but it can be tricky to get it right. There are lots of little gotchas you need to watch out for."

Some other realted websites & questions:

One thing I know about push services, is that it uses a lot of resource. Also look at Reverse AJAX.

Community
  • 1
  • 1
TheCarver
  • 19,391
  • 25
  • 99
  • 149