我在本地主机上托管 WCF 服务,并且客户端在同一主机上运行,它在同一台机器上运行时运行良好,但是当我将客户端安装在另一台机器上并尝试连接到服务器时,它失败了......这是服务器的配置文件
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="wsDualBinding">
<security mode="None" />
</binding>
</wsDualHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="Metadata">
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="Metadata" name="ChatService.ChatManager">
<endpoint address="duplex" binding="wsDualHttpBinding" bindingConfiguration="wsDualBinding"
contract="ChatService.IChat" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:2525/chat/" />
<!--<add baseAddress="net.tcp://localhost:1717/chat/" />-->
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>
客户端配置
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="NewBinding0">
<security mode="None" />
</binding>
</wsDualHttpBinding>
</bindings>
<client>
<endpoint address="http://192.168.1.10:2525/chat/duplex" binding="wsDualHttpBinding"
bindingConfiguration="NewBinding0" contract="ChatService.IChat" name="mgr" />
</client>
</system.serviceModel>
</configuration>
它给了我那个错误
套接字连接被中止。这可能是由于处理您的消息时出错或远程主机超出接收超时,或底层网络资源问题引起的