问题描述
AS3程序保持连接打开,虽然URLLoader实例,使用close()方法关闭。立即一旦数据被加载任何方式关闭连接?
AS3 program keeps connection open though URLLoader instance is closed using close() method.Is any way to shutdown connection immediately once data is loaded?
使用netstat命令的命令行检查连接状态,它显示为Eshtablished。
Checking connection status from commandline using netstat command, it is showing as Eshtablished.
请建议。
推荐答案
的URLLoader是一个HTTP包装。你必须使用HTTP的东西来完成它。 为了关闭连接,你就必须发送连接:关闭
HTTP头以及Web服务器响应(注意,默认为最Web服务器是连接:保持活动
,这是你所看到的行为)
URLLoader is a HTTP wrapper. You have to use HTTP stuff to get it done. In order to close the connection you would have to send the Connection: close
HTTP header along with the webserver response. (Note that the default for most webservers is Connection: Keep-Alive
, and it is the behaviour you are seeing).
为了把它从Flash发送到服务器,你就必须有受信任的本地
或 AIR应用程序
沙箱。在浏览器中运行(在互联网上)时,这是不可能的。
In order to send it from Flash to the server, you would have to have the local-trusted
or AIR application
sandbox. This is not possible when running in a browser (on the internet).
在文档:
在Flash Player和应用程序安全沙箱以外的Adobe AIR内容,以下请求标头无法使用,且限制的术语不区分大小写(例如,获取,获取,和GET均不得使用)。
In Flash Player and in Adobe AIR content outside of the application security sandbox, the following request headers cannot be used, and the restricted terms are not case-sensitive (for example, Get, get, and GET are all not allowed). Also, hyphenated terms apply if an underscore character is used (for example, both Content-Length and Content_Length are not allowed):
接收字符集,接受编码,接受,范围,年龄,允许,允许,授权,荷,连接,连接,内容长度,内容,地点,内容范围,饼干,日期,删除,ETag的,期待,获取,头,主机,如果修改 - 因为,保持活动,最后修改,地理位置优越,马克斯 - 远期,期权,产地,邮政,代理服务器进行身份验证,代理授权,代理连接,公共,放,范围,引用站点,要求,范围,重发后,服务器,TE,跟踪,拖车,传输编码,升级,URI,用户代理,因人而异,威盛,警告,WWW身份验证,的X闪光版本。
Accept-Charset, Accept-Encoding, Accept-Ranges, Age, Allow, Allowed, Authorization, Charge-To, Connect, Connection, Content-Length, Content-Location, Content-Range, Cookie, Date, Delete, ETag, Expect, Get, Head, Host, If-Modified-Since, Keep-Alive, Last-Modified, Location, Max-Forwards, Options, Origin, Post, Proxy-Authenticate, Proxy-Authorization, Proxy-Connection, Public, Put, Range, Referer, Request-Range, Retry-After, Server, TE, Trace, Trailer, Transfer-Encoding, Upgrade, URI, User-Agent, Vary, Via, Warning, WWW-Authenticate, x-flash-version.
这篇关于AS3 - 如何关闭TCP连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!