本文介绍了客户端/服务器如何同步客户端上的方法执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个简单的客户端服务器应用程序,该应用程序允许服务器向将同时运行方法的所有客户端发送命令.
如何确保客户端将同时执行该方法?(延迟时间为毫秒)
我以为可以使用SNTP,但是我不知道如何集成它.
有什么建议吗?


我需要在LAN环境中完全同时开始播放视频.
该视频在客户端计算机上(不广播).
客户端计算机之间的播放必须同步
最多应支持50个客户.
服务器机器将在(50米)附近
[/编辑]

对不起,英语不好

I need a simple client server application that allows the server to send a command to all clients that will run a method at the same time.
How can I make sure that the clients will perform the method at the same time?(milliseconds of delay)
I thought the use of SNTP but I do not know how to integrate it.
Any suggestions?


I need to start a video at exactly the same time on a LAN enviroment.
The video is on client machines (No broadcast).
The playback between client machines must be synchronized
Should support up to 50 clients.
The server machine will be near (50 meters)
[/Edit]

Sorry for bad english

推荐答案



  1. 我想这些机器仅专用于此任务,除了播放在多个屏幕上播放的一个视频外,没有其他目的
  2. 在机器启动时让应用程序运行.
  3. li>
  4. 当应用程序启动并配置为运行视频(LAN)时,机器会向服务器发送某种就绪信号.
  5. 每个客户端都有一个小的硬件模块,可用于输入一个说12V的信号.当服务器通过LAN发出即将开始播放的信号时,将不断轮询输入.这是繁忙的等待过程,因此应该只在很小的时间间隔内发生.客户端需要确认他们现在处于轮询模式(也通过LAN)
  6. 将客户端置于轮询模式(包括等待所有客户端确认已这样做)之后,服务器将发送通过一些专用的HW(输出12V信号)通过屏蔽电缆向所有客户端发出信号,这些电缆的长度应相同.
  7. 在轮询指示后,客户端便开始播放视频并确认通过LAN发送到服务器
  8. 也可以通过LAN发送停止信号,因为它并不那么重要.
  9. 在您的情况下,您还可以让服务器在上面广播时间戳由于所有机器都靠近局域网,因此延迟的差异可以忽略不计.对于各种各样的事情来说,这是很不错的,其中的一种事情是能够确定客户端是否及时响应服务器的服务请求.

  1. I presume the machines are dedicated to this task only and don''t have any other purpose than to play one video spread over several screens
  2. Have the application run when the machines are started.
  3. The machines send some sort of ready signal to the server when the application is started and configured to run the video (LAN).
  4. Each client has a small HW module that allows for input of a say 12V signal. The input is polled constantly when the server has signaled via LAN that playing is about to start. This is busy waiting and should thus only take place for a small time interval. The clients need to acknowledge that they are now in polling mode (also over LAN)
  5. After putting the clients into polling mode (including having waited for all of them to acknowledge having done so) the server will send a signal to all clients via some dedicated HW (output 12V signal) over shielded cables which should be all of the same length.
  6. As soon as the polling indicates it, the clients start to play the video and acknowledge that over LAN to the server
  7. Sending a stop signal could also be done via LAN as it is not that critical.
  8. In your scenario you could also have the server broadcast a time stamp over the LAN as all machines are close together differences in latency will be negligible. This would be nifty for all sorts of things one of which being able to decide if a client responded in a timely fashion to a service request by the server.



那情况怎么样?

干杯!



How about that scenario?

Cheers!


这篇关于客户端/服务器如何同步客户端上的方法执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 01:28
查看更多