WCF服务调用中的"线程正在中止"

igo*_*gor 1 c# asp.net ajax wcf prtg

在我的程序中有一个包含wcf客户端的aspx页面,所以在同一服务器上调用wcf服务.

当我的wcf客户端调用生产服务器上的IIS中托管的wcf服务时,我会得到此异常.

防爆.味精: Thread was being aborted.

Ex堆栈:

在System.Net.UnsafeNclNativeMethods.OSSOCK.recv(IntPtr的socketHandle,BYTE*pinnedBuffer,LEN的Int32,的SocketFlags的SocketFlags)在System.Net.Sockets.Socket.Receive(字节[]缓冲液,的Int32偏移的Int32大小,的SocketFlags的SocketFlags,SocketError&的errorCode)在System.Net.Sockets.NetworkStream.Read(字节[]缓冲液,的Int32偏移的Int32大小)在System.Net.PooledStream.Read(字节[]缓冲液,的Int32偏移的Int32大小)在System.Net.Connection .SyncRead(HttpWebRequest的请求,布尔userRetrievedStream,布尔probeRead)在System.Net.ConnectStream.ProcessWriteCallDone(ConnectionReturnResult returnResult)在System.Net.ConnectStream.CallDone(ConnectionReturnResult returnResult)在System.Net.ConnectStream.ResubmitWrite(ConnectStream oldStream,布尔suppressWrite )在System.Net.HttpWebRequest.EndWriteHeaders_Part2()在System.Net.HttpWebRequest.EndWriteHeaders(布尔异步)在System.Net.HttpWebRequest.WriteHeadersCallback(WebExceptionStatus ErrorStatus中,ConnectStream流,布尔异步)在System.Net.ConnectStream.WriteHeaders(布尔异步)在System.Net.位于System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)的System.ServiceModel.Channels.RequestChannel.Request(消息消息,TimeSpan超时)处的System.Net.HttpWebRequest.GetResponse()处的HttpWebRequest.EndSubmitRequest()在System.ServiceModel.Dispatcher.RequestChannelBinder.Request(消息消息,时间跨度超时)在System.ServiceModel.Channels.ServiceChannel.Call(字符串动作,布尔单向,ProxyOperationRuntime操作,对象[]项,对象[]奏,TimeSpan超时)System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall,ProxyOperationRuntime操作)在System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&msgData,System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message))处. Int32类型)在StationService.Station.ClService.GetCurrentStationTrack(String stationId)at StationService.StationServiceClient.GetCurrentStationTrack(String stationId)at GetSongJS.getMarq(String radioIdentifier)位于StationService.StationServiceClient.GetCurrentStationTrack(String stationId)的Station上的PrivateInvoke(MessageData&msgData,Int32类型),位于GetSongJS.getMarq(String radioIdentifier)的StationService.StationServiceClient.GetCurrentStationTrack(String stationId)位于StationService.StationServiceClient.GetCurrentStationTrack(String stationId)的Station上的PrivateInvoke(MessageData&msgData,Int32类型),位于GetSongJS.getMarq(String radioIdentifier)的StationService.StationServiceClient.GetCurrentStationTrack(String stationId)

我使用PRTG Ipmonitor,它给了我太多关于"请求当前"传感器的请求.我的网站在浏览器中变得可用.如果删除这个调用service all的页面就可以了.

Shi*_*iji 6

听起来你没有关闭WCF客户端.

我认为发生的是:

  • 用户调用aspx页面
  • aspx页面调用该服务
  • aspx页面返回给用户
  • 服务客户端未关闭,因此请求已打开,当前请求数很多
  • 最终你有最大数量的请求打开
  • 页面等待一个免费连接,当它没有得到一个aspx页面超时
  • 然后从超时中获取线程中止异常