The Connector.open method is a factory for connections. You do not use the new operator to instantiate connections. This is a smart mechanism, which keeps the static footprint small when the platform does not include implementations for specific connections. The method throws ConnectionNotFoundException if the desired protocol handler is not available.
//Open an interface with openDevice(NetworkInterface intrface, int snaplen, boolean promics, int to_ms) JpcapCaptor captor=JpcapCaptor.openDevice(devices[index], 65535, false, 20); captor.setFilter("tcp && src port 6000", true); It'll filter all the TCP packets with source port number 6000. So, all we need to do is pass the parameters and use logical and, or operators.
Comments
Post a Comment