|
SourceForge Jpcap | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<PacketCapture.LoopMode>
net.sourceforge.jpcap.capture.PacketCapture.LoopMode
public static enum PacketCapture.LoopMode
LoopModes determine how the PacketCapture.capture(int)
and PacketCapture.captureTo(int, net.sourceforge.jpcap.capture.PacketOutputStream)
methods behave in the presence of timeouts.
For libpcap programmers, this enumeration specifies whether to call pcap_loop()
or pcap_dispatch().
If capturing from a file, LoopMode.Dispatch is identical to LoopMode.Loop.
If not set, the default LoopMode is LoopMode.Loop.
PacketCapture.capture(int)
,
PacketCapture.getLoopMode()
,
PacketCapture.setLoopMode(net.sourceforge.jpcap.capture.PacketCapture.LoopMode)
,
PacketCapture.configureBlocking(boolean)
Enum Constant Summary | |
---|---|
Dispatch
The Dispatch mode causes packet captures to run until either:
no packets have arrived within the timeout period specified when the capture device was opened,
the count is exhausted (if positive),
the input file is exhausted (if capturing from a savefile), or
PacketCapture.endCapture() is called. |
|
Loop
The Loop mode causes packet captures to run until either:
the count is exhausted (if positive),
the input file is exhausted (if capturing from a savefile), or
PacketCapture.endCapture() is called. |
Method Summary | |
---|---|
static PacketCapture.LoopMode |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static PacketCapture.LoopMode[] |
values()
Returns an array containing the constants of this enum type, in the order they're declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final PacketCapture.LoopMode Loop
Loop
mode causes packet captures to run until either:
PacketCapture.endCapture()
is called.
timeout
parameter specified when opening the capture device is used
only to determine how long the capture loop waits for another packet to arrive before
starting to call callbacks for those that have already arrived: this is a measure to
reduce context switches.
For libpcap programmers, this value causes the capture methods to call pcap_loop().
public static final PacketCapture.LoopMode Dispatch
Dispatch
mode causes packet captures to run until either:
PacketCapture.endCapture()
is called.
In addition, if the capture device is in non-blocking mode, the capture methods return immediately if there are no packets ready to be captured at the moment it is called.
The timeout
parameter specified when opening the capture device is used
both for this purpose and to determine how long the capture loop waits for another packet to arrive before
starting to call callbacks for those that have already arrived: this is a measure to
reduce context switches.
For libpcap programmers, this value causes the capture methods to call pcap_dispatch().
PacketCapture.configureBlocking(boolean)
Method Detail |
---|
public static final PacketCapture.LoopMode[] values()
for(PacketCapture.LoopMode c : PacketCapture.LoopMode.values()) System.out.println(c);
public static PacketCapture.LoopMode valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
|
Copyright © Patrick Charles & Jonas Lehmann, 2001; Esmond Pitt, 2008. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |