public abstract class ChannelPacketHandler extends PacketHandler
Provides the base class for Java SocketChannel based packet handler implementations.
Modifier and Type | Field and Description |
---|---|
protected byte[] |
m_headerBuf |
Constructor and Description |
---|
ChannelPacketHandler(SocketChannel sockChannel,
int typ,
String name,
String shortName,
CIFSPacketPool packetPool)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
int |
availableBytes()
Return the count of available bytes in the receive input stream
|
void |
closeHandler()
Close the protocol handler
|
void |
flushPacket()
Flush the output socket
|
SocketChannel |
getSocketChannel()
Return the socket channel
|
protected int |
readBytes(byte[] pkt,
int offset,
int len)
Read bytes from the socket channel
|
protected void |
writeBytes(byte[] pkt,
int off,
int len)
Write bytes to the output socket channel
|
getClientName, getPacketPool, getRemoteAddress, getShortName, hasClientName, hasDebug, hasRemoteAddress, isProtocol, isProtocolName, readPacket, rethrowException, setClientName, setDebug, setRemoteAddress, writePacket, writePacket, writePacket
public ChannelPacketHandler(SocketChannel sockChannel, int typ, String name, String shortName, CIFSPacketPool packetPool) throws IOException
sockChannel
- SocketChanneltyp
- intname
- StringshortName
- StringpacketPool
- CIFSPacketPoolIOException
- If a network error occurspublic final SocketChannel getSocketChannel()
public int availableBytes() throws IOException
availableBytes
in class PacketHandler
IOException
- If a network error occurs.protected int readBytes(byte[] pkt, int offset, int len) throws IOException
pkt
- byte[]offset
- intlen
- intIOException
- If a network error occurs.protected void writeBytes(byte[] pkt, int off, int len) throws IOException
pkt
- byte[]off
- intlen
- intIOException
- If a network error occurs.public void flushPacket() throws IOException
flushPacket
in class PacketHandler
IOException
- If a network error occurspublic void closeHandler()
closeHandler
in class PacketHandler
Copyright © 2005–2018 Alfresco Software. All rights reserved.