关于wcf中的tcp端点
现在查看tcp端点关于wcf中的tcp端点,wcf,Wcf,现在查看tcp端点 <endpoint address="tcp" binding="netTcpBinding" bindingConfiguration="tcpBinding" contract="ChatService.IChat"/> tcp端点地址没有url,而tcp这个词被分配给了地址属性…为什么 给我一个可以是有效tcp url的示
<endpoint address="tcp"
binding="netTcpBinding"
bindingConfiguration="tcpBinding"
contract="ChatService.IChat"/>
tcp端点地址没有url,而tcp这个词被分配给了地址属性…为什么
给我一个可以是有效tcp url的示例url
无论是规则还是约定,tcp端点的地址字段都将始终具有名为“tcp”的固定字
这是完整的装订样本
如果没有完整的配置文件,我无法告诉您确切的情况,但我的猜测是: I.address=“tcp” a。主机基址有一个设置,因此完整地址将是基址+tcp。例如,以下服务具有基址
。。。
我提供了完整的绑定示例……请看一看,告诉我人们使用什么地址创建代理。如果我在上面给出的配置中省略了基址,那么就可以创建代理了吗?您好,人们用来创建代理的地址是net。tcp://localhost:1645/ChatServer/tcpthanks 但我也可以给mex地址,比如net。tcp://localhost:1645/ChatServer/mex 创建代理。那么,告诉我使用两个不同的url创建代理有什么区别。另一个重要的问题是,为什么要公开两个url来创建代理…有什么特别的原因吗。如果您没有指定以开头的整个地址,请引导…谢谢scheme://address 然后将使用默认的基址。创建代理没有任何区别。有两个不同的基址,因为其中一个用于tcp协议(baseAddress=“net。tcp://localhost:1645/ChatServer/)和http协议()的另一个端点的完整地址将是net。tcp://localhost:1465/ChatServer/tcp
(第一部分来自net.tcp
方案的基址,其余部分来自实际端点定义)
<service name="WCFService.Service" behaviorConfiguration="behaviorConfig">
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:1645/ChatServer/"/>
<add baseAddress="http://localhost:1648/ChatServer/"/>
</baseAddresses>
</host>
<endpoint address="tcp"
binding="netTcpBinding"
bindingConfiguration="tcpBinding"
contract="ChatService.IChat"/>
<endpoint address="net.tcp://localhost:1645/ChatServer/mex"
binding="mexTcpBinding"
contract="IMetadataExchange"/>
</service>
...
<host>
<baseAddresses>
<add baseAddress="net.tcp://MyServerIPAddress:9000/MyService.svc" />
</baseAddresses>
</host>
...
<endpoint address="net.tcp://MyServerIPAddress:9000/tcp"
binding="netTcpBinding"
bindingConfiguration="tcpBinding"
contract="ChatService.IChat"/>