net.sf.jbaobab.io
Class SocketHandler<P>

java.lang.Object
  extended by net.sf.jbaobab.io.SocketHandler<P>
All Implemented Interfaces:
ChannelHandler<SocketChannel>

public class SocketHandler<P>
extends Object
implements ChannelHandler<SocketChannel>

A ChannelHandler that handles SocketCore.

Author:
Oakyoon Cha
See Also:
SocketCore, PacketHandler

Constructor Summary
SocketHandler(SocketCore<P> core, PacketHandler<P> handler)
           
 
Method Summary
 void connected()
           
 void disconnected()
           
 void prepare(SocketChannel channel, ChannelManager<SocketChannel> receiver, ChannelManager<SocketChannel> sender)
           
 int receive()
           
 int send()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketHandler

public SocketHandler(SocketCore<P> core,
                     PacketHandler<P> handler)
Method Detail

prepare

public void prepare(SocketChannel channel,
                    ChannelManager<SocketChannel> receiver,
                    ChannelManager<SocketChannel> sender)
Specified by:
prepare in interface ChannelHandler<SocketChannel>

receive

public int receive()
            throws IOException
Specified by:
receive in interface ChannelHandler<SocketChannel>
Throws:
IOException

send

public int send()
         throws IOException
Specified by:
send in interface ChannelHandler<SocketChannel>
Throws:
IOException

connected

public final void connected()
Specified by:
connected in interface ChannelHandler<SocketChannel>

disconnected

public final void disconnected()
Specified by:
disconnected in interface ChannelHandler<SocketChannel>