public abstract class SocketPacketHandler extends PacketHandler
Provides the base class for Java Socket based packet handler implementations.
Constructor and Description |
---|
SocketPacketHandler(java.net.Socket sock,
int typ,
java.lang.String name,
java.lang.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(java.net.Socket sock, int typ, java.lang.String name, java.lang.String shortName, CIFSPacketPool packetPool) throws java.io.IOException
sock
- Sockettyp
- intname
- StringshortName
- String
2param packetPool CIFSPacketPooljava.io.IOException
- If a network error occurspublic int availableBytes() throws java.io.IOException
availableBytes
in class PacketHandler
java.io.IOException
- If a network error occurs.protected int readBytes(byte[] buf, int offset, int len) throws java.io.IOException
java.io.IOException
- If a network error occurs.protected void writeBytes(byte[] pkt, int off, int len) throws java.io.IOException
pkt
- byte[]off
- intlen
- intjava.io.IOException
- If a network error occurs.public void flushPacket() throws java.io.IOException
flushPacket
in class PacketHandler
java.io.IOException
- If a network error occurspublic void closeHandler()
closeHandler
in class PacketHandler
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.