简体   繁体   English

用于流式传输到异步Web请求的服务器端技术

[英]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. 我需要编写一个C#应用程序,它将作为服务在Windows服务器上运行。

This application will be responsible for sending JSON snippets to connected clients. 此应用程序将负责将JSON片段发送到已连接的客户端。

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. 客户端将使用异步WebRequest进行连接,我希望对有效负载进行Gzip编码,以减少从线路发送到每个连接客户端的数据包的大小。 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. 连接客户端后,它们将尽可能长时间保持连接状态,因此服务器将每隔x秒发送一次心跳。

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? 我可以使用套接字和标准TCP / IP与WebRequest连接方法吗?

我最后和HttpListener一起去了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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