2010年7月29号 -- 关于Error:Error #2030:end of the file was encounted.
The socket is now connector... Error: Error #2030: 遇到文件尾。
at flash.net::Socket/readUTF() at send()
昨天在写as3.0与java服务端socket连接时的一个错误,上网上查看一些评论和注释,最后还是英文网站给我了真正的原因解析,此错误来源于
EOFError; An EOFError exception is thrown when you attempt to read past the end of the available data.For example,an EOFError is thrown when one of the read methods in the IDataInput interface is called and there is insufficient data to satisfy the read request.
下面是一个英文论坛网上的问题和解决办法:
Using Action Script 3 in Flex Builder 3:
When handing a SOCKET_DATA event,I occasionally,seemingly at random,get an "Error #2030:End of file was encoutered." When calling socket.readInt().I'm confused as to want this error means,since I'm not reading a file?I'm a little unfamilier with sockets.Thanks.
2 Answers:
when reading off a socket,that is closed,you will get:Error #2002:Operation attempted on invalid socket. end of fiel errors typically occur on any bytestreams,if you read more bytes than avaliable ... this is the case for files,sockets,etc....in the case of flash,it occurs when reading from a Socket or a ByteArray and maybe even in other cases...
TCP/IP is package based,but emulates a stream...thus you can only read the data off the stream,that was already sent to you with TCP packages...check Socket::byteAvaliable to find out,how many bytes are currently avaliable...always keep in mind,that the data you write to the socket in one operation may arrive in mutiple packages,each very probably causing flash player to trigger socketData events...
于是我就修改我的.as文件,查看socket.byteAvaliable 然后利用 socket.readUTFBytes(socket.byteAvaliable)进行查看,结果依然是这样,说明我根本没有接收到数据。 最后在javaEye上看到一个astionscript与socket交互的教程,才发现是应该写事件的,但是我没有些;至于为什么写事件,以及事件写了以后有什么效果,仍然学习中。。。待续。。。
分享到:
相关推荐
泛微OA xmlrpcServlet接口任意文件读取漏洞(CNVD-2022-43245),可以指定文件路径进行读取,并提供检测方案
修改显示框宽度较长-----VC6.0 读取网上文件---.rar
Android----文件的保存与读取 设置简单的界面,有提交按钮, 在文本编辑框输入内容,单击按钮 将内容保存!
读取matlab数据文件(.mat)一个库。它可以把.mat文件转换成C/C++结构体。很实用。
jQuery是一个快速、简洁的JavaScript框架,丰富的Javascript代码库,在其1.7.2版本的sys_dia_data_down模块存在任意文件读取漏洞,攻击者可通过前台读取任意文件。
MIT-BIH ECG 信号的数据读取Matlab程序,能够读取MIT-BIH数据库 .atr、.dat、.hea三种文件的数据,根据这些数据计算出实际的心电信号值,并绘制出信号波形。
load-json-file - 读取和解析JSON文件
若依(RuoYi)管理系统 后台任意文件读取漏洞描述若依管理系统是基于SpringBoot的权限管理系统,登录后台后可以读取服务器上的任意文件漏洞影响app=
检测脚本
Spring Boot 定时通过sftp 从linux服务器下载.csv文件,读取文件,并写入数据库
NULL 博文链接:https://baobeituping.iteye.com/blog/1280825
“读取数据记录文件”位于函数选板的“编程→文件I/O→文件函数→数据文件→读取数据记录文件”,图标和接线端如图8-31所示。 读取数据记录文件从指定的文件中读取记录数据,从当前的日志位置开始读取。输入和...
泛微云桥 e-Bridge 任意文件读取
若依(RuoYi)管理系统 后台任意文件读取漏洞描述若依管理系统是基于SpringBoot的权限管理系统,登录后台后可以读取服务器上的任意文件漏洞影响app=
wav格式的声音文件格式详解,方便自己编程实现wav文件读取的时候了解文件格式
使用matlab读取mit-bih的心电图信号
delphi保存读取utf-8的文本文件.mht
VBA Fans读取和写入UTF-8格式文本文件
风云四(FY-4)数据读取代码-读取试例包括HDF、HRIT以及NC三种格式数据