【问题标题】:The socket connection was aborted in wcf套接字连接在 wcf 中中止
【发布时间】:2013-04-19 10:37:31
【问题描述】:

我在服务器端创建了动态端点,客户端使用该端点。

服务器端代码:

 for (int i = 1; i <= 3; i++)
            {
                host.AddServiceEndpoint(typeof(PokerService.IPlayerService),
                                               new NetTcpBinding(),
                                               @"net.tcp://localhost:5054/player" + i);

            }

客户端:

NetTcpBinding binding = new NetTcpBinding(SecurityMode.Message);
binding.Name = "NetTcpBinding_IPlayerService";
binding.Security.Message.ClientCredentialType = MessageCredentialType.IssuedToken;


EndpointAddress myEndpointAdd = new EndpointAddress(new Uri("net.tcp://localhost:5054/player1"),
EndpointIdentity.CreateDnsIdentity("pident.cloudapp.net"));

var PlayerChannelFactory = new DuplexChannelFactory<ClientApplication.PlayerService.IPlayerService>(new PlayerHandler(handler, this), binding, myEndpointAdd);

但它在以下行中给出错误:

Player loggedIn = PlayerServiceProxy.Login("testuser" + Guid.NewGuid().ToString());

错误是:

“套接字连接被中止。这可能是由于处理您的消息时出错或远程主机超出接收超时,或底层网络资源问题。本地套接字超时为“00:00:59.9870000”。 "

有人知道吗?

【问题讨论】:

    标签: c# wcf sockets nettcpbinding


    【解决方案1】:

    好像超时了。检查您的客户端和服务超时配置。

    另外,尝试使用 svcTraceViewer.exe 查看 wcf 跟踪

    【讨论】:

      猜你喜欢
      • 2011-04-28
      • 1970-01-01
      • 1970-01-01
      • 2019-12-28
      • 2011-07-09
      • 2019-05-05
      • 2014-11-22
      • 1970-01-01
      • 2015-08-17
      相关资源
      最近更新 更多