| Constructor and Description |
|---|
TCPFramer() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(Buffer data)
Check whether the supplied data could be framed into a frame of this
type.
|
TCPPacket |
frame(IPPacket parent,
Buffer buffer)
Ask the framer to frame the buffer into a packet.
|
Protocol |
getProtocol() |
public Protocol getProtocol()
getProtocol in interface Framer<IPPacket,TCPPacket>public TCPPacket frame(IPPacket parent, Buffer buffer) throws java.io.IOException
Packet has not been parsed, just framed.public boolean accept(Buffer data) throws java.io.IOException
Framer will read a few bytes in an effort to
figure out if the incoming data may be something it recognizes. E.g., a
HTTP Framer could check if the first bytes match "GET", "POST",
"PUT" and "DELETE" if if so assume that the payload indeed is HTTP and
therefore return true. Of course, you may never really know until you
actually have parsed the entire body but this method should return quick
and if turns out that the data isn't what it thought, throw an exception
and the framework will take care of it.Copyright © 2018. All Rights Reserved.