org.red5.server.net.udp
Class BasicHandler
java.lang.Object
org.apache.mina.core.service.IoHandlerAdapter
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static org.slf4j.Logger log
timer
protected Timer timer
sessions
protected Set<IoSession> sessions
showInfo
protected boolean showInfo
BasicHandler
public BasicHandler()
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