客户端窗体等待,直到WCF服务处于活动状态 [英] Client form waits until WCF service is active

查看:98
本文介绍了客户端窗体等待,直到WCF服务处于活动状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!
我正在使用WCF服务(自托管)net.tcp.

WCF主机是控制台应用程序,客户端是WindowsForm应用程序.

客户端打开表格,它为空白.在运行WCF主机之前,如何使客户表单保持空白)?

现在->如果我先打开客户端,然后再托管.我在客户端出现异常.

希望您确实了解我的问题! :)

Hi!
I am using WCF service (self-hosted), net.tcp.

WCF host is a console application and the client a WindowsForm application.

Client opens form and it is blank. How I can make that clients form will stay blank until i run WCF host)???

For now -> if i first open client and then host. I get exception on client.

I hope that you did understand my issue! :)

推荐答案

如果WCF主机尚未启动时客户端应用程序引发异常,则当进行连接尝试.
如果您发现由于该服务尚未启动而无法建立连接,请让您的客户端设置一个计时器,该计时器使您可以在经过一定延迟后重试连接.


干杯,

Manfred
If the client application throws an exception when the WCF host isn''t yet started you''ll have some exception handling to do in your client when making the connection attempt.
If you find that a connection isn''t possible because the service isn''t started yet, have your client set a timer that will enable you to retry connecting at after a certain delay.


Cheers,

Manfred


您可以让客户端应用程序定期检查服务器应用程序是否正在运行...
You could just have the client app periodically check to see if the server app is running...


这篇关于客户端窗体等待,直到WCF服务处于活动状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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