public class EchoFilter extends Object implements TCPProxyFilter
TCPProxyFilter.FilterException
Constructor and Description |
---|
EchoFilter(PrintWriter output)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
connectionClosed(ConnectionDetails connectionDetails)
A connection has been closed.
|
void |
connectionOpened(ConnectionDetails connectionDetails)
A new connection has been opened.
|
byte[] |
handle(ConnectionDetails connectionDetails,
byte[] buffer,
int bytesRead)
Handle a message fragment from the stream.
|
public EchoFilter(PrintWriter output)
output
- Where to direct output.public byte[] handle(ConnectionDetails connectionDetails, byte[] buffer, int bytesRead) throws TCPProxyFilter.FilterException
handle
in interface TCPProxyFilter
connectionDetails
- Describes the connection.buffer
- Contains the data.bytesRead
- How many bytes of data in buffer
.byte[]
which will be transmitted to the server instead of
buffer
.TCPProxyFilter.FilterException
- If an error occurs.public void connectionOpened(ConnectionDetails connectionDetails)
connectionOpened
in interface TCPProxyFilter
connectionDetails
- Describes the connection.public void connectionClosed(ConnectionDetails connectionDetails)
connectionClosed
in interface TCPProxyFilter
connectionDetails
- Describes the connection.Copyright © 2000-2014. All Rights Reserved.