public abstract class SocketPacketHandler extends Object implements PacketHandlerInterface
Modifier | Constructor and Description |
---|---|
protected |
SocketPacketHandler(Socket socket)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
int |
availableBytes()
Return the number of bytes available for reading without blocking
|
void |
closePacketHandler()
Close the packet handler
|
abstract String |
getProtocolName()
Return the protocol name
|
protected Socket |
getSocket()
Return the socket
|
int |
readPacket(byte[] pkt,
int offset,
int maxLen)
Read a packet of data
|
void |
writePacket(byte[] pkt,
int offset,
int len)
Write a packet of data
|
protected SocketPacketHandler(Socket socket) throws IOException
socket
- SocketIOException
public abstract String getProtocolName()
getProtocolName
in interface PacketHandlerInterface
public int availableBytes() throws IOException
availableBytes
in interface PacketHandlerInterface
IOException
public int readPacket(byte[] pkt, int offset, int maxLen) throws IOException
readPacket
in interface PacketHandlerInterface
pkt
- byte[]offset
- intmaxLen
- intIOException
public void writePacket(byte[] pkt, int offset, int len) throws IOException
writePacket
in interface PacketHandlerInterface
pkt
- byte[]offset
- intlen
- intIOException
public void closePacketHandler()
closePacketHandler
in interface PacketHandlerInterface
protected final Socket getSocket()
Copyright © 2005–2018 Alfresco Software. All rights reserved.