WCF 与 DHCP 双工?
我在运行的这个类似聊天的应用程序中使用双工 WCF 合约。 (显然这不是真正的聊天,但为了思考它的兴趣,你可以假设它足够相似)。
问题是许多讨论此合同的客户都在运行 dhcp,对此我无能为力。
处理 dhcp 双工通信的最佳方法是什么?我发现了一个设置
这意味着我可以在运行时更新这个值......似乎有点混乱。
更新 我发现在我的 WCF 服务器日志中,部分问题在于它将主机名放入响应地址中。我在这里做错了什么?
谢谢
I'm using a duplex WCF contract in this chat-like application that i have running. (obviously not really a chat, but for the interest of thinking about it you can assume it's similar enough).
the problem is that many of the clients that talk over this contract are running dhcp, and there's not really anything i can do about this.
What's the best way to handle duplex communication with dhcp? I found a setting <compositeDuplex clientBaseAddress="Uri"/>
which means i could update this value at runtime.... seems a bit kludgy.
Update
I found that in my WCF server logs, part of the problem is that it was putting hostname in the response address. what am i doing wrong here?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
坦率地说,您做错的第一件事是使用 DualHttpBinding 进行双工。整个绑定是一个巨大的拼凑,很容易出现这样的问题(还有防火墙,天哪,防火墙)。
如果您使用 net.tcp 之类的东西,那么客户端会建立到服务器的单个双向连接,而不是需要两个连接,因此服务器不再关心客户端是否在 DHCP 上。
To be blunt, the first thing that you're doing wrong is using DualHttpBinding to do duplex. That whole binding is a giant kludge and is prone to problems like this (and firewalls, oh god firewalls).
If you were to use something like net.tcp instead then the clients establish a single bidirectional connection to the server instead of needing two connections, and thus the server doesn't care if the client is on DHCP anymore.