I'm not able to accept the connection request that i'm getting. i'm using TCP/IP protocol and jpcap libraries.
I use wireshark to see the data packets i'm getting from other system but, my code does not seem like accepting the connection request to further receive data request, How do i resolve this problem?
Code:
JpcapCaptor captor = null;
int index = 0;
jpcap.NetworkInterface[] devices;
{
devices = JpcapCaptor.getDeviceList();
for (int i = 0; i < devices.length; i++) {
System.out.println(i + ": " + devices[i].name + "(" + devices[i].description + ")");
System.out.println(" datalink: " + devices[i].datalink_name + "(" + devices[i].datalink_description + ")");
System.out.print(" MAC address:");
for (byte b : devices[i].mac_address) {
System.out.print(Integer.toHexString(b & 0xff) + ":");
System.out.println();
}
for (NetworkInterfaceAddress a : devices[i].addresses) {
System.out.println(" address:" + a.address + " " + a.subnet + " " + a.broadcast);
}
}
try {
//Open an interface with openDevice(NetworkInterface intrface, int snaplen, boolean promics, int to_ms)
captor = JpcapCaptor.openDevice(devices[0], 65535, false, 5000);
captor.setFilter("ip and tcp", true);
} catch (IOException e) {
e.printStackTrace();
}
Comment