[英]xmlrpc and System.Net.WebException .net 3.5 c#
我使用CookComputing.XmlRpc;
尝试使用一些请求连接到trac,但是我得到了:
System.Net.WebExceptionStatus.ReceiveFailure
{“底层连接已关闭:接收时发生意外错误。”}
{“无法从传输连接读取数据:现有连接被远程主机强行关闭。”}
答:当我使用Visual Studio 2008运行应用程序时,错误是间歇性的 。
B-当我运行已编译的应用程序时,它将永远无法运行 。
C-当我使用提琴手聆听时,我的应用程序始终可以运行 (从Visual Studio或编译的)
这是我用的:
//Trac Code
[XmlRpcUrl("http://trac:8080/Project/login/xmlrpc")]
public interface Trac : IXmlRpcProxy
{
[XmlRpcMethod("ticket.query")
int[] query(string queryStr);
[XmlRpcMethod("ticket.get")]
object[] get(int id);
}
用法:
//sometimes it fails here:
int[] a = proxy.query("status!=closed&owner=" + user);
//sometimes here:
foreach (int ticketid in a)
{
tickets.Add((proxy.get(ticketid))[3]);
System.Threading.Thread.Sleep(1000);
}
提琴手的作品使我想起了“缓冲”与“非缓冲”流。 由于提琴手会缓冲整个流以显示,然后将其完全发送出去,因此可能会导致行为更改,因此是Visual Studio调试器的思想。
这不是一个真正的答案,但可能导致领先。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.