- Type Parameters:
U
- the generic user type
- All Superinterfaces:
PcapHandler
- Enclosing interface:
PcapHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
OfMemorySegment
relies on preview features of the Java platform:
OfMemorySegment
refers to one or more preview APIs:MemorySegment
.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
An advanced low level, no copy, packet handler. The packets dispatched using
this handler are no copied and memory segments reference into native pcap
ring-buffer and are only safe to use during the duration of handler call.
After the handler returns that packet memory is no longer valid and may throw
an exception if tried to access.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jnetpcap.PcapHandler
PcapHandler.NativeCallback, PcapHandler.OfArray<U>, PcapHandler.OfByteBuffer<U>, PcapHandler.OfMemorySegment<U>
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handleSegment
(U user, MemorySegmentPREVIEW header, MemorySegmentPREVIEW Packet) Packet handler method.
-
Method Details
-
handleSegment
Packet handler method. This method get called to handle or consume a pcap packet.- Parameters:
user
- the userheader
- the headerPacket
- the packet
-
OfMemorySegment
when preview features are enabled.