There is any way to build http server on the WP7? Actually I need handling GET request from another part of applicatio开发者_高级运维n.
Thank you in advance!
It is not possible to do this with WP7. The Mango version does introduce raw sockets support, but only for client side connections. They do not implement TcpListener which is what you need to implement a proper HTTP connection.
I've seen other apps use a polling mechanism over http, where the client (the app) polls the server to see if there are any requests for it to process.
With Mango you could do something similar, although you could use the raw sockets to maintain a stateful connection so you wouldn't have to necessarily poll - the client (the app) would maintain a connection to the server and the server could then just send "get" requests as required. Of course this isn't HTTP exactly but depending on your scenario that might work, although there are many scenarios where that wouldn't be a good idea.
If you are just talking about GET requests, I assume you are looking at static pages? Would serving a file from isolated storage be an option in this case? If so, there are quite a few examples of how to do this without having to implement a web server locally. This one, for example.
精彩评论