openr66.protocol.networkhandler.packet
Class NetworkPacket

java.lang.Object
  extended by openr66.protocol.networkhandler.packet.NetworkPacket

public class NetworkPacket
extends Object

Network Packet A Packet is composed of one global length field, two Id (4 bytes x 2) and a buffer. The first Id is the localId on receive operation and the remoteId on send operation. The second Id is the reverse.

Author:
Frederic Bregier

Constructor Summary
NetworkPacket(int localId, int remoteId, AbstractLocalPacket packet)
           
NetworkPacket(int localId, int remoteId, byte code, org.jboss.netty.buffer.ChannelBuffer buffer)
           
 
Method Summary
 org.jboss.netty.buffer.ChannelBuffer getBuffer()
           
 byte getCode()
           
 int getLocalId()
           
 org.jboss.netty.buffer.ChannelBuffer getNetworkPacket()
           
 int getRemoteId()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NetworkPacket

public NetworkPacket(int localId,
                     int remoteId,
                     byte code,
                     org.jboss.netty.buffer.ChannelBuffer buffer)
Parameters:
localId -
remoteId -
code -
buffer -

NetworkPacket

public NetworkPacket(int localId,
                     int remoteId,
                     AbstractLocalPacket packet)
              throws OpenR66ProtocolPacketException
Parameters:
localId -
remoteId -
packet -
Throws:
OpenR66ProtocolPacketException
Method Detail

getBuffer

public org.jboss.netty.buffer.ChannelBuffer getBuffer()
Returns:
the buffer

getRemoteId

public int getRemoteId()
Returns:
the remoteId

getLocalId

public int getLocalId()
Returns:
the localId

getCode

public byte getCode()
Returns:
the code

getNetworkPacket

public org.jboss.netty.buffer.ChannelBuffer getNetworkPacket()
Returns:
The corresponding ChannelBuffer

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2012 Frederic Bregier. All Rights Reserved.