在客户端上从WCF服务远程启动进程。 [英] Remotely starting a process from the WCF service, on a client.

查看:97
本文介绍了在客户端上从WCF服务远程启动进程。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我有一个WCF服务,可以检测客户端何时不再运行。它还会通过ping检查该计算机是否仍处于活动状态。如果他们还活着,我希望强制重启客户端应用程序。



有谁知道一个简单的方法来实现这个目标?



问候,



Jib

解决方案

你不能直接这样做,你不应该这样做。请参阅我对该问题的评论。



如果客户端断开连接,则不会仅存在该服务。一切都是由客户的倡议触发,而不是服务。



事实上你可以ping客户端的主机意味着什么。当您可以ping某事时,这意味着您与某些服务进行通信,而不是客户端。要成功ping通,主机应运行实现ICMP协议的服务器:

http:// en。 wikipedia.org/wiki/Internet_Control_Message_Protocol [ ^ ],

http://en.wikipedia.org/wiki/Ping_%28networking_utility%29 [ ^ ]。



您应该尝试找到导致您的连接过早破坏并修复它的错误,而不是将其视为技术滥用的方向。这是一种通用且非常重要的工程方法:不要试图用额外的结构掩盖你和其他的错误。



-SA

Hi there,

I have a WCF service that detects when a client is no longer running. It also checks if that machine is still alive with a ping. If they are alive I wish to force a restart of the client app.

Does anyone know of an easy way to achieve this?

Regards,

Jib

解决方案

You cannot directly do it, and you should not. Please see my comment to the question.

If the client is disconnected, it does not simply exist for the service. Everything is triggered by the initiative of the client, not service.

The fact that you can ping the client's host means nothing. When you can ping something, it means you communicate with some service, not client. To be successfully pinged, the host should run a server implementing the ICMP protocol:
http://en.wikipedia.org/wiki/Internet_Control_Message_Protocol[^],
http://en.wikipedia.org/wiki/Ping_%28networking_utility%29[^].

Instead of thinking it the direction of total technology abuse, you should rather try to find a bug which causes your connection to break prematurely and fix it. This is a general and very important approach to engineering: don't try to cover up your and other's bugs with additional constructs.

—SA


这篇关于在客户端上从WCF服务远程启动进程。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆