org.alliance.core.comm
Class PacketConnection

java.lang.Object
  extended by org.alliance.core.comm.Connection
      extended by org.alliance.core.comm.PacketConnection
Direct Known Subclasses:
AuthenticatedConnection, HandshakeConnection

public abstract class PacketConnection
extends Connection

Created by IntelliJ IDEA. User: maciek Date: 2006-jan-25 Time: 16:10:48


Nested Class Summary
 
Nested classes/interfaces inherited from class org.alliance.core.comm.Connection
Connection.Direction
 
Field Summary
 
Fields inherited from class org.alliance.core.comm.Connection
bandwidthIn, bandwidthOut, bytesReceived, bytesSent, connected, core, direction, hasWriteInterest, key, netMan, statusString
 
Constructor Summary
protected PacketConnection(NetworkManager netMan, Connection.Direction direction)
           
protected PacketConnection(NetworkManager netMan, Connection.Direction direction, java.lang.Object key)
           
 
Method Summary
 long getLastPacketSentAt()
           
 int getPacketsReceived()
           
 void init()
           
abstract  void packetReceived(Packet p)
           
 void readyToSend()
           
 void received(java.nio.ByteBuffer buf)
           
 void send(Packet p)
           
 
Methods inherited from class org.alliance.core.comm.Connection
bytesReceived, bytesSent, close, getBandwidthIn, getBandwidthOut, getBytesReceived, getBytesSent, getConnectionId, getConnectionIdForRemote, getDirection, getKey, getNetMan, getStatusString, hasWriteInterest, isConnected, setHasWriteInterest, setKey, setStatusString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PacketConnection

protected PacketConnection(NetworkManager netMan,
                           Connection.Direction direction)

PacketConnection

protected PacketConnection(NetworkManager netMan,
                           Connection.Direction direction,
                           java.lang.Object key)
Method Detail

init

public void init()
          throws java.io.IOException
Overrides:
init in class Connection
Throws:
java.io.IOException

packetReceived

public abstract void packetReceived(Packet p)
                             throws java.io.IOException
Throws:
java.io.IOException

send

public void send(Packet p)
          throws java.io.IOException
Throws:
java.io.IOException

readyToSend

public void readyToSend()
                 throws java.io.IOException
Specified by:
readyToSend in class Connection
Throws:
java.io.IOException

received

public void received(java.nio.ByteBuffer buf)
              throws java.io.IOException
Specified by:
received in class Connection
Throws:
java.io.IOException

getLastPacketSentAt

public long getLastPacketSentAt()

getPacketsReceived

public int getPacketsReceived()