public interface StreamListener<T extends Packet>
Packet that belongs to a particular Stream has
been detected by the StreamHandler, it will call its registered
StreamListeners.| Modifier and Type | Method and Description |
|---|---|
void |
endStream(Stream<T> stream)
Called when the
Stream has ended. |
void |
packetReceived(Stream<T> stream,
T packet)
Called when a new
Packet has been received. |
void |
startStream(Stream<T> stream,
T packet)
Called when a new
Stream is detected. |
void startStream(Stream<T> stream, T packet)
Stream is detected.
Note that the Packet passed in to this method will NOT appear in
packetReceived(Stream, Packet).void packetReceived(Stream<T> stream, T packet)
Packet has been received.void endStream(Stream<T> stream)
Stream has ended. There are many reasons why a
Stream ends and it depends on the type of Stream. For
some types of a Streams, there is no "natural" end so
occasionally Streams will be determined dead after some kind of
timeout. For other protocols, such as SIP, the Stream will end
when the dialog dies (if there is a dialog established in the first
place).
Note that unlike startStream(Stream, Packet) the event that
kills the Stream may not actually be a Packet but may
just as well be timer based and as such, there is no Packet
supplied along with the endStream(Stream) method.
Note, when this method is called, it is guaranteed that there will be no
more Packets for this Stream so it is safe to e.g. write
this Stream to file e.g. by using the PcapOutputStream.stream - the Stream that just ended.Copyright © 2021. All Rights Reserved.