josx.rcxcomm
Class LNPAddressingHandler
java.lang.Object
josx.rcxcomm.PacketHandler
josx.rcxcomm.LNPAddressingHandler
- public class LNPAddressingHandler
- extends PacketHandler
Packet handler that implements LNP addressing.
Method Summary |
boolean |
isPacketAvailable()
Check if a packet is available |
void |
open(byte source,
byte destination)
Set the source and destination for this connection |
int |
receivePacket(byte[] buffer)
Receive a packet. |
boolean |
sendPacket(byte[] packet,
int len)
Send a packet, adding the source and destination addresses |
LNPAddressingHandler
public LNPAddressingHandler(PacketHandler handler)
open
public void open(byte source,
byte destination)
- Set the source and destination for this connection
- Overrides:
open
in class PacketHandler
sendPacket
public boolean sendPacket(byte[] packet,
int len)
- Send a packet, adding the source and destination addresses
- Specified by:
sendPacket
in class PacketHandler
- Parameters:
packet
- the bytes to sendlen
- the number of bytes to send
- Returns:
- true if the send was successful, else false
receivePacket
public int receivePacket(byte[] buffer)
- Receive a packet.
- Specified by:
receivePacket
in class PacketHandler
- Parameters:
buffer
- the buffer to rceive the packet into
- Returns:
- the number of bytes received
isPacketAvailable
public boolean isPacketAvailable()
- Check if a packet is available
- Specified by:
isPacketAvailable
in class PacketHandler
- Returns:
- true if a Packet is available, else false