|
List Info
Thread: Connection problem with AS3 and Red5...
|
|
| Connection problem with AS3 and Red5... |

|
2006-11-27 22:55:22 |
|
Hello all:
I've been working on a couple of Flex2 client applications for Red5. I've created a Red5Connection class which wraps the NetConnection class. (Note: I made sure to declare the encoding to be AMF0.) I connect to Red5 via the following client function:
public function connect(... args):void { log.debug("connect: " + args);
if (!conn.connected) { // Attempt to connect to the server. conn.connect(getServerUrl(), args); // Start the connection timeout timer. timer = new Timer(timeOut, 1);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, connectionTimedOut); timer.start(); } } Please take note of the function signature '... args'. Essentially it translates the comma delimited arguments of the function into an array for use within its body. When connecting using a call such as connect('carl', 'password'); I get the following error in Red5:
ERROR [26 Nov 2006 17:22:43,435]
org.red5.server.net.rtmp.codec.RTMPProtocolDecoder (SLF4JLog.java:171)
- Error in packet at 1934 java.lang.NumberFormatException: For input string: "length" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Integer.parseInt
(Integer.java:447) at java.lang.Integer.parseInt(Integer.java:497) at org.red5.io.object.Deserializer.readMixedArray(Deserializer.java:163) at org.red5.io.object.Deserializer.deserialize(Deserializer.java
:86) at org.red5.server.net.rtmp.codec.RTMPProtocolDecoder.decodeNotifyOrInvoke(RTMPProtocolDecoder.java:559) at org.red5.server.net.rtmp.codec.RTMPProtocolDecoder.decodeInvoke(RTMPProtocolDecoder.java
:494) at org.red5.server.net.rtmp.codec.RTMPProtocolDecoder.decodeMessage(RTMPProtocolDecoder.java:350) at org.red5.server.net.rtmp.codec.RTMPProtocolDecoder.decodePacket(RTMPProtocolDecoder.java:278)
at org.red5.server.net.rtmp.codec.RTMPProtocolDecoder.decode(RTMPProtocolDecoder.java:123) at org.red5.server.net.rtmp.codec.RTMPProtocolDecoder.decodeBuffer(RTMPProtocolDecoder.java:92) at
org.red5.server.net.rtmp.codec.RTMPMinaProtocolDecoder.decode(RTMPMinaProtocolDecoder.java:50) at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:158) at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived
(AbstractIoFilterChain.java:502) at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:52) at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived
(AbstractIoFilterChain.java:777) at org.apache.mina.common.support.AbstractIoFilterChain$1.messageReceived(AbstractIoFilterChain.java:111) at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived
(AbstractIoFilterChain.java:502) at org.apache.mina.common.support.AbstractIoFilterChain.fireMessageReceived(AbstractIoFilt | |