org.red5.server.net.udp
Class BasicHandler

java.lang.Object
  extended by org.apache.mina.core.service.IoHandlerAdapter
      extended by org.red5.server.net.udp.BasicHandler
All Implemented Interfaces:
IoHandler

public class BasicHandler
extends IoHandlerAdapter

=> client send to server <= server send to client << server broadcast Connecting to the server => byte(join) << byte(join) int(id) => byte(list) <= byte(list) int(count) int(id) int(id) ... Sending a message to all => byte(send) [..anything..] << byte(send) [..anything..] Server ping client to keep alive, every second <= byte(noop) => byte(noop) Timeouts (after 10s no reply) << byte(exit) int(id)

Author:
luke

Nested Class Summary
protected  class BasicHandler.TimeoutTask
           
 
Field Summary
protected static org.slf4j.Logger log
           
protected  Set<IoSession> sessions
           
protected  boolean showInfo
           
protected  Timer timer
           
 
Constructor Summary
BasicHandler()
           
 
Method Summary
protected  void broadcast(IoSession exclude, IoBuffer data)
           
protected  void echo(IoSession session, IoBuffer data)
           
 void exceptionCaught(IoSession session, Throwable ex)
           
protected  void join(IoSession session)
           
protected  void leave(IoSession session)
           
protected  void list(IoSession to)
           
 void messageReceived(IoSession session, Object message)
           
 void sessionCreated(IoSession session)
           
 
Methods inherited from class org.apache.mina.core.service.IoHandlerAdapter
messageSent, sessionClosed, sessionIdle, sessionOpened
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.slf4j.Logger log

timer

protected Timer timer

sessions

protected Set<IoSession> sessions

showInfo

protected boolean showInfo
Constructor Detail

BasicHandler

public BasicHandler()
Method Detail

exceptionCaught

public void exceptionCaught(IoSession session,
                            Throwable ex)
                     throws Exception
Specified by:
exceptionCaught in interface IoHandler
Overrides:
exceptionCaught in class IoHandlerAdapter
Throws:
Exception

messageReceived

public void messageReceived(IoSession session,
                            Object message)
                     throws Exception
Specified by:
messageReceived in interface IoHandler
Overrides:
messageReceived in class IoHandlerAdapter
Throws:
Exception

echo

protected void echo(IoSession session,
                    IoBuffer data)

broadcast

protected void broadcast(IoSession exclude,
                         IoBuffer data)

list

protected void list(IoSession to)

leave

protected void leave(IoSession session)

join

protected void join(IoSession session)

sessionCreated

public void sessionCreated(IoSession session)
                    throws Exception
Specified by:
sessionCreated in interface IoHandler
Overrides:
sessionCreated in class IoHandlerAdapter
Throws:
Exception


Copyright © 2006-2010 The Red5 Project