.NET /软硬度:如何从阅读的URLRequest部分结果? [英] .Net/Flex: How to read partial results from URLRequest?
问题描述
我正在这与Flex的执行的批处理程序脚本。批处理脚本是在.aspx页面中,并通过以下类返回部分结果:
I'm working on a batch process script that's executed from Flex. The batch script is in a .aspx Page and returns partial results through the following class:
public class ResponseLogger
{
private HttpResponse _response;
public ResponseLogger(HttpResponse response)
{
this._response = response;
}
public void Start()
{
_response.Clear();
_response.ContentType = "text/plain";
_response.ContentEncoding = System.Text.Encoding.GetEncoding("ISO-8859-1");
}
public void End()
{
_response.End();
}
public void Br()
{
Log("");
}
public void Underline(string message)
{
Log(message);
Log("".PadLeft(message.Length, '-'));
}
public void Log(string message)
{
_response.Write(message + "\n");
_response.Flush();
}
}
在我的Flex应用程序,我想尽快,因为它是刷新在服务器端显示的结果。可以这样做使用ActionScript?
In my Flex application I'd like to show the result as soon as it's flushed on server side. Can this be done using Actionscript?
推荐答案
简短的回答,不,你不能,除非你做短/长轮询(每分钟几个HTTP调用)做主持HTTP部分结果。 HTTP在它的本质是一个请求 - 响应协议。
Short answer, no, you cannot do partial results over HTTP unless you do short/long polling (several http calls per minute). HTTP in it's essence is a request-response protocol.
你想要的是一个推送技术,但我不知道是否有一个.NET相当于此。在Java方面,你得到的BlazeDS和GraniteDS的推送消息。
What you want is a push technology, but I'm not sure if there's a .NET equivalent for this. On the Java side you got BlazeDS or GraniteDS for push messaging.
另一个问题是,你为什么结果部分?
The other question is why are you results 'partial'?
这篇关于.NET /软硬度:如何从阅读的URLRequest部分结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!