Re: Persistent (long) http connection
Dave Lacerte <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.web |
|---|---|
| Message-ID | <[email protected]> |
Hello, I would consider using .net remoting, which keeps the tcp/ip connection opened as long as one side does not close it. I don't know about mobile clients though (do they automatically close the "line"? Do they accept incoming packets without prior request?) Keep in mind that web services are inherently stateless and absolutely stupid when it comes to keeping a link with the clients. It's by design; we're talking about the web here. On the other hand, I never used it, but I know that when your web service proxy gets built in the IDE (or with wsdl.exe), it receives code for asynchronous functions. I guess a call to one function (asynchronously) could block on the server until data is ready (could lead to many extra threads on the server, though). Then, the client would only consult IAsyncResult for the IsCompleted property... But that sounds a little "broche a foin" (cheezy) as a solution... Anyways the call to IsCompleted will much probably result in a request to the server. Conclusion: I would consider .net remoting. Dave. http://omniscient.ca > I have a mobile device which needs to know about new data pretty much as > soon as it is available. I have a web service that I can poll to find > out about the data, but it's a question of when I poll it. > > Since this device is connected over a mobile (GPRS) connection, and data > is not free, I'd like to avoid a solution which just polls every 60 > seconds or similar. > > So I'd like to make an http(s) connection that is "up" as long as it can > be, which will just return some data is going to be available over the > web service. On the server side I can do whatever tricks I can > (probably just polling the database occasionally - which could be > changed to using sql 2005 notifications when are clients move to sql > 2005), and return when there is something new. But there won't be any > data going over the link so usage costs will be kept down. When the > client notices a disconnect, then it can just re-connect. I'm pretty > sure this is a similar mechanism to Exchange Server works from mobile > units. > > This strikes me as something which will have been done before - or > perhaps there are better ways of doing it? Any tips, tricks or > web-links appreciated - google hasn't turned up anything for me. > > Best wishes > James > > =================================== > This list is hosted by DevelopMentor® http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com