开发者

Instantiating ServiceController takes sometimes too much time

i am creating an instance of ServiceController using a remote/local machine name and the name of the service.开发者_如何学Go When I type sth. like stackoverflow.com as machine name the contructor blocks for a long time and returns an exception.

Example:

string MachineName = "stackoverflow.com"
ServiceController("RemoteRegistry", MachineName );

How can I set here a kind of timeout to cancel this process?


This is subject to the standard TCP/IP connection time-outs. The same ones you see when trying to visit a web site that's off line with your browser. Yes, you can change them by editing the registry. You can make them longer. Not shorter.

Perhaps you can ping it first if this often fails.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜