简体   繁体   中英

Server side technology for streaming to async webrequests

I need to write a C# application that will sit and run as a service on a windows server.

This application will be responsible for sending JSON snippets to connected clients.

Clients will be connecting using an Asynchronous WebRequest and I want to Gzip encode the payloads to reduce the size of the packets being sent down the wire to each connected client. The data being sent to each client will differ so I need to manage all the connections as well.

Once a client is connected, they will remain connected for as long as possible, so the server will be sending heartbeats every x number of seconds.

I have not done programming like this since my days back in uni and wondered what the best way of achieving this was?

Can I use Sockets and standard TCP/IP with the WebRequest connection method?

我最后和HttpListener一起去了。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM