org.freeswitch.esl.client.transport.message
Class EslFrameDecoder
java.lang.Object
org.jboss.netty.channel.SimpleChannelUpstreamHandler
org.jboss.netty.handler.codec.replay.ReplayingDecoder<org.freeswitch.esl.client.transport.message.EslFrameDecoder.State>
org.freeswitch.esl.client.transport.message.EslFrameDecoder
- All Implemented Interfaces:
- ChannelHandler, ChannelUpstreamHandler
public class EslFrameDecoder
- extends ReplayingDecoder<org.freeswitch.esl.client.transport.message.EslFrameDecoder.State>
Decoder used by the IO processing pipeline. Client consumers should never need to use
this class.
Follows the following decode algorithm (from FreeSWITCH wiki)
Look for \n\n in your receive buffer
Examine data for existence of Content-Length
If NOT present, process event and remove from receive buffer
IF present, Shift buffer to remove 'header'
Evaluate content-length value
Loop until receive buffer size is >= Content-length
Extract content-length bytes from buffer and process
- Author:
- david varnes
EslFrameDecoder
public EslFrameDecoder(int maxHeaderSize)
EslFrameDecoder
public EslFrameDecoder(int maxHeaderSize,
boolean treatUnknownHeadersAsBody)
Copyright © 2009-2010 david varnes. All Rights Reserved.