gpt4 book ai didi

silverlight - Silverlight 客户端和 WCF 服务之间的间歇性通信问题

转载 作者:行者123 更新时间:2023-12-03 17:58:41 25 4
gpt4 key购买 nike

我有一个 Silverlight 4 应用程序,它与运行 IIS 7.5 的服务器进行通信,该服务器承载了我自己的许多 WCF 服务。该应用程序在 99% 的时间内运行良好,但用户报告说,每天有几次应用程序会卡住或在应用程序的不同点生成错误消息。

我打开了 WCF 跟踪,出现以下错误:

<Exception>
<ExceptionType>System.ServiceModel.ProtocolException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
<Message>The number of bytes available is inconsistent with the HTTP Content-Length header. There may have been a network error or the client may be sending invalid requests. </Message>
<StackTrace>
at System.ServiceModel.Channels.HttpInput.ReadBufferedMessage(Stream inputStream)
at System.ServiceModel.Channels.HttpInput.ParseIncomingMessage(Exception&amp; requestException)
at System.ServiceModel.Channels.HttpChannelListener.HttpContextReceived(HttpRequestContext context, Action callback)
at System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state)
at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
</StackTrace>
</Exception>

然后我在用户的机器上运行 Fiddler,发现发生了以下错误:
HTTP/1.1 504 Fiddler - Receive Failure
Content-Type: text/html; charset=UTF-8
Connection: close
Timestamp: 18:24:21.941

ReadResponse() failed: The server did not return a response for this request.

从一些研究来看,客户端和服务器之间似乎存在一些通信问题。该服务器是一个虚拟专用服务器,我从来没有遇到过任何问题,并且从查看日志来看,它永远不会使处理器/内存达到最大值。

我的问题是:
1. 我能做些什么来更详细地跟踪正在发生的事情,或者我可以调整任何与 IIS 或服务器相关的内容以避免此错误
2. 在我的 Silverlight 应用程序中,有什么方法可以等待特定的时间(例如 30 秒),如果没有收到响应,请取消当前请求并重试

最佳答案

关于silverlight - Silverlight 客户端和 WCF 服务之间的间歇性通信问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6827804/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com