What is the purpose of the "user" field in the nextPacket() method?

1 reply [Last post]
Bill Evans
Joined: 09/11/2015

What is the intention of the 'user' field in:

public void nextPacket(PcapPacket packet, T user);

Thanks in advance for your help. Great product.

Mark Bednarczyk
Joined: 03/22/2008
Lets you pass in any type of

Lets you pass in any type of object that is helpful to your handler. A good usage for it is to pass some kind of 'state' object. So if you use the same handler with multiple PCAP interfaces, each one can keep different state and you do not have to perform any kind of lookup (per interface) to get at a state object.

Sly Technologies, Inc.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.