[英]C# WCF - Custom Server-Side Monitoring Implementation
Do you want to know what's currently going on in the server or do you also want to keep a history of what has happened? 您是否想知道服务器中当前正在发生的事情,还是想保留发生的事情的历史记录?
If you only want to know what is going on at this moment, my solution would be to maintain the current server state in-memory (this shouldn't be too hard) and have the monitoring client call the server when it wants to know what is happening. 如果您仅想知道此时发生了什么,我的解决方案是将当前服务器状态保持在内存中(这应该不太困难),并让监视客户端在服务器想知道什么时调用服务器正在发生。
If you want to keep a history of what has happened, you need some data store where the server can write events to. 如果要保留已发生事件的历史记录,则需要服务器可以向其中写入事件的数据存储。 The monitoring client can then read this data store to show what is happening now and what has happened in the past. 然后,监视客户端可以读取此数据存储,以显示现在正在发生的事情以及过去发生的事情。 Even better would be if the client did not have direct access to this data store but instead contacts the server to obtain the relevant information. 如果客户端没有直接访问此数据存储的权限,而是与服务器联系以获得相关信息,那就更好了。 This way you hide the implementation details of your monitoring history from the client. 这样,您可以从客户端隐藏监视历史记录的实现详细信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.