如何使双向通信使用.NET通知双向、通信、通知、NET

2023-09-03 20:28:31 作者:我的世界没有你的存在

我有一台服务器/客户端项目,我使用C#进行编码,WCF的服务器。我仅限于HTTP,没有运气与wsdualhttpbinding至今。项目致力于公司的网络上。

I have a server/client project, I am using C# for coding, WCF as server. I am limited to HTTP, had no luck with wsdualhttpbinding so far. Project is working on company network.

有没有办法从服务器发送通知给客户以任何方式比WCF双工其他?请告诉所有选项。

Is there any way to send notifications from server to client in any way other than WCF duplex? Please tell all options.

推荐答案

我假设,因为你有问题,传入连接防火墙问题。

I am assuming because of firewall issues you have problems with an incoming connection.

在这种情况下,以解决该问题的常用方法是

In such a scenario a common way to solve the problem is.

有从中使用服务请求的 A 也许 GetNextNotification 轮询服务器一个单独的线程 在这方面应该有一个较高的超时时间。 在服务器端时的 A 的处理方法不会返回,直到有一些服务器想要传达的客户端 当 A 返回客户端处理的通知,并让另一个 A 的要求。 Have a separate thread from which you poll the server using the service request A maybe GetNextNotification This connection should have a high timeout. On the server side when A is processed the method doesn't return until there is something server wants to convey to the client Once A returns the client processes the notification and makes another A request.