public abstract class SocketPacketHandler extends PacketHandler
Provides the base class for Java Socket based packet handler implementations.
Constructor and Description |
---|
SocketPacketHandler(Socket sock,
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
|
protected int |
readBytes(byte[] buf,
int offset,
int len)
Read bytes from the socket input stream
|
protected void |
writeBytes(byte[] pkt,
int off,
int len)
Write bytes to the output socket stream
|
getClientName, getPacketPool, getRemoteAddress, getShortName, hasClientName, hasDebug, hasRemoteAddress, isProtocol, isProtocolName, readPacket, rethrowException, setClientName, setDebug, setRemoteAddress, writePacket, writePacket, writePacket
public SocketPacketHandler(Socket sock, int typ, String name, String shortName, CIFSPacketPool packetPool) throws IOException
sock
- Sockettyp
- intname
- StringshortName
- String
2param packetPool CIFSPacketPoolIOException
- If a network error occurspublic int availableBytes() throws IOException
availableBytes
in class PacketHandler
IOException
- If a network error occurs.protected int readBytes(byte[] buf, int offset, int len) throws IOException
IOException
- 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.