Web service in an application
I am using an increasing number of applications which can be serviced from a web page. These apps do not need tomcat, apache or IIS to be installed but they are able to serve out web pages on demand.
Question is how is this done? Is it just a thead polling a port, waiting for a mime message and then chucking out the content or is it something more complex than that?
Re: Web service in an application
essentially... yes. Although it doesn't necessarily need to be on a separate thread, it is possible to implement the webserver portion on your main GUI thread without too much problems. and without causing the UI to hang/stutter.
If those apps can service webpages accessible using a webbrowser, than that is what they do. There are quite a few technologies to achieve this though, from accessing raw sockets, to class libraries, to high level libraries such as WinHttp and the HTTP server api.
Re: Web service in an application
Thanks - I didn't know about winhttp and HTTP server API. That's a good starting point.
Re: Web service in an application
if you have a regular application then WinHttp would be the route to take. The HTTP ServerApi 'sort of' needs to run elevated, although there are ways around that, but they're somewhat complex.