org.freeswitch.esl.client.transport.message
Class EslFrameDecoder

java.lang.Object
  extended by org.jboss.netty.channel.SimpleChannelUpstreamHandler
      extended by org.jboss.netty.handler.codec.replay.ReplayingDecoder<org.freeswitch.esl.client.transport.message.EslFrameDecoder.State>
          extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
ChannelHandler.Sharable
 
Constructor Summary
EslFrameDecoder(int maxHeaderSize)
           
EslFrameDecoder(int maxHeaderSize, boolean treatUnknownHeadersAsBody)
           
 
Method Summary
 
Methods inherited from class org.jboss.netty.handler.codec.replay.ReplayingDecoder
channelClosed, channelDisconnected, exceptionCaught, messageReceived
 
Methods inherited from class org.jboss.netty.channel.SimpleChannelUpstreamHandler
channelBound, channelConnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, writeComplete
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EslFrameDecoder

public EslFrameDecoder(int maxHeaderSize)

EslFrameDecoder

public EslFrameDecoder(int maxHeaderSize,
                       boolean treatUnknownHeadersAsBody)


Copyright © 2009-2010 david varnes. All Rights Reserved.