NetConnection.Connect的几种错误

作者:网络 来源:佚名 更新时间:2009-01-18 12:07:03 点击:

本文例举了netconnection.connect的几种错误。

有以下这几种返回:
1、netconnection.call.failed error
netconnection.call() 调用服务器端方法失败。返回的info对象包含一个具体的调用失败说明。for in一下可以看到。

2、netconnection.connect.appshutdown error
服务器端应用程序因为一些原因被关闭(过度占用server端资源),或者服务器已经被关闭。

3、netconnection.connect.closed status
连接中断。

4、netconnection.connect.failed error
连接失败。如fms 没有启动。

5、netconnection.connect.invalidapp error
targeturi中rtmp://[ip或domain]/[appname]
其中appname不存在。

6、netconnection.connect.rejected error
连接被拒绝 原因:
targeturi指定的application不充许client连接,或者传递给应用程序的参数不对,也可能是server应用程序直接拒绝连接(可以在appname文件夹中写一个asc文件做到)
这时,info对象有一个application属性,包含服务器方法application.rejectconnection()的返回值。
client在被拒绝后会马上再收到一个netconnection.connect.closed的信息。

7、netconnection.connect.success status
连接成功。
当返回是netconnection.connect.fail时,可以从下面几个方面思考原因:
are you connecting to the correct server?
is the server running?
are you specifying the protocol (rtmp:) for connecting to the server?
if you are connecting from behind a firewall, are you specifying the correct protocol (rtmpt:)?
attempts to connect to the server can also fail if the permissible number of socket connectionson either the client or the server computer is at its limit. this limit is ependent on how much physical memory your server has, and how busy the connections are. on windows systems,the memory for socket connections is allocated out of the non-paged memory, so it cannot beswapped out to a page file. you may see that you reach the maximum limit at different valuesfrom time to time as other running programs (such as core operating-system services) arecompeting with your program for space in the non-paged memory pool.