简体   繁体   English

处理多个客户端C#

[英]handling multiple clients c#

I am working on a project where i need to connect with multiple clients and every client is streaming live screen capturing to server. 我正在一个需要与多个客户端连接并且每个客户端都将实时屏幕捕获流传输到服务器的项目中。 Server show that. 服务器显示。

What would be the best approach for that. 最好的方法是什么。

Thank You 谢谢

You can use WCF in streaming mode for the video, but I doubt it is a good solution. 您可以在视频流模式下使用WCF,但是我怀疑这是一个好的解决方案。

I think that going for pure sockets is better, to get the performance required. 我认为使用纯套接字更好,以获得所需的性能。 Showing a live video stream is also not really a limited operation (which is what WCF is built for), but rather something ongoing. 实时视频流的显示并不是一个有限的操作(这是WCF的目标),而是正在进行的操作。

My suggestiion is to: 我的建议是:

  • Use a pure TCP socket for the video stream for a start. 将纯TCP套接字用于视频流作为开始。
  • If that gives problems, you can switch to UDP. 如果出现问题,则可以切换到UDP。 It is better to skip over any lost packages for live video, but with UDP you have to track package ordering etc. yourself. 最好跳过任何丢失的直播视频包,但使用UDP则必须自己跟踪包的订购等。
  • If you need control operations, use a separate WCF service for that. 如果需要控制操作,请为此使用单独的WCF服务。

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

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