I am building a Push notification system, for Android.
I have an ASP.NET web application, hosted on a commercial hosting provider. I have one page that almost always is in an infinite loop waiting for an event to occur.
One host (Android device) loads this page, and remains connected on a persistent connection, till that event occurs. When it occurs, it serves it, and goes back to waiting for it to occur again.
Now, my question is, Is this page being in a perpetual loop, and always connected to a client going to affect the performance of the rest of the web application?
(I think it should not, because servers handle loads of client connections anyway. Am I correct in assuming this?)
Should I deploy this on a different application pool on the server?
Also, is there a better way of doing Push notifications, using persistent connections?
Thanks in advance…
Based on your description, you’re going to run into issues. First, having a page that loops forever is going to cause timeout errors (connection timeout defaults to something like 120 seconds). Which, by the way, will cause the app pool to fail/shut down based on how fast it happens (I’ve accidentally done this, trust me it’s not good).
If you don’t have to have 100% real time notifications, I’d use a polling setup (let them hit your page once every couple of minutes). If you do have to have 100% real time notifications, and you’re targeting 2.2 on up, use Cloud to Device Messaging. Otherwise you’re best option will be to create a server application and not going the ASP.Net approach.