通信对象System.ServiceModel.Channels.ServiceChannel 无法用于通信,因为其处于“出错”状态

<!--服务器端的配置如下: -->

< services >
       < service   name = " SQS.Demo.Server.Ticket "   behaviorConfiguration = " TicketBehavior " >
         < endpoint   address = " TicketService "   binding = " netTcpBinding " bindingConfiguration = " TicketBindingConfiguration "   contract = " SQS.Demo.Contract.ITicket "   />
         < endpoint   address = " mex "   contract = " IMetadataExchange "   binding = " mexTcpBinding "   />
         < host >
           < baseAddresses >
             < add   baseAddress = " net.tcp://192.168.20.114:9001 " />
           </ baseAddresses >
         </ host >  
       </ service >

       < service   name = " SQS.Demo.Server.Hotel "   behaviorConfiguration = " TicketBehavior " >
         < endpoint   address = " HotelService "   binding = " netTcpBinding " bindingConfiguration = " TicketBindingConfiguration "   contract = " SQS.Demo.Contract.IHotel "   />
         < endpoint   address = " hotel "   contract = " IMetadataExchange "   binding = " mexTcpBinding "   />
         < host >
           < baseAddresses >
             < add   baseAddress = " net.tcp://192.168.20.114:9001 " />
           </ baseAddresses >
         </ host >
       </ service >

     </ services >

     < behaviors >
       < serviceBehaviors >
         < behavior   name = " TicketBehavior " >
           < serviceThrottling   maxConcurrentCalls = " 5000 "   maxConcurrentSessions = " 5000 " maxConcurrentInstances = " 5000 " />
           < serviceMetadata   httpGetEnabled = " false " />
           < serviceDebug   includeExceptionDetailInFaults = " true " />
         </ behavior >
       </ serviceBehaviors >
     </ behaviors >

     < bindings >
       < netTcpBinding >
         < binding    name = " TicketBindingConfiguration "    openTimeout = " 00:30:00 " receiveTimeout = " 00:30:00 "    sendTimeout = " 00:30:00 "    maxBufferSize = " 2147483647 " maxReceivedMessageSize = " 2147483647 " >
           < security   mode = " None "   />
           < readerQuotas    maxStringContentLength = " 6553600 "   maxArrayLength = " 6553600 "   />
         </ binding >
       </ netTcpBinding >
     </ bindings >



<!--客服端的配置如下:-->

<client>
      <endpoint address="net.tcp://192.168.20.114:9001/TicketService"
       binding="netTcpBinding" bindingConfiguration="NetTcpBinding_TicketService1"
       contract="ServiceTicket.TicketService" name="NetTcpBinding_TicketService1" />

</client>



receiveTimeout="00:30:00"已经设置为30分钟了。
现在把InactivityTimeout也设置为30分钟就可以了。

通道闲置时间太久 也会出错。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值