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 - SocketIOExceptionpublic abstract String getProtocolName()
getProtocolName in interface PacketHandlerInterfacepublic int availableBytes()
throws IOException
availableBytes in interface PacketHandlerInterfaceIOExceptionpublic int readPacket(byte[] pkt,
int offset,
int maxLen)
throws IOException
readPacket in interface PacketHandlerInterfacepkt - byte[]offset - intmaxLen - intIOExceptionpublic void writePacket(byte[] pkt,
int offset,
int len)
throws IOException
writePacket in interface PacketHandlerInterfacepkt - byte[]offset - intlen - intIOExceptionpublic void closePacketHandler()
closePacketHandler in interface PacketHandlerInterfaceprotected final Socket getSocket()
Copyright © 2005–2014 Alfresco Software. All rights reserved.