Platform-independent way to listen to TCP connections in a Java application

91 views Asked by At

For context, I'm writing an add-on to a Java-based server program that will calculate the latency of each IP connected to the server based on the recent TCP packet timings. The server API that I'm working with provides no way of doing this.

What I'd like to do is use a TCP listener to listen for all local activity on the server port and store recent time-stamped seq/acks for all IPs. I've looked into some libraries like pcap4j, but due to their platform-specific dependencies this is not ideal as the server software runs on many different operating systems.

Does anyone know of a Java library that can listen to TCP connections and provide the IP and seq/ack numbers? The listener should be able to run in a multi-threaded environment, or otherwise avoid blocking the main thread. I've looked everywhere for something like this to no avail.

Thanks.

0

There are 0 answers