0

Capturing the time after the accept() function does not indicate the time when the TCP SYN was initially received.

Any help is appreciated. Thanks.

Albert
  • 1
  • 2
    What's the use case for this? A network monitoring utility (tcpdump) should provide a time stanp of all packets. – markspace Aug 02 '17 at 16:51
  • 1
    Short answer: No. The TCP handshake is likely handled by the OS, not Java. Java *uses* the TCP protocol, it doesn't *implement* it. – Andreas Aug 02 '17 at 16:55
  • I have several systems on the network and I'm doing some one-way latency studies which I want to implement in Java. I know pcap-based tools can capture the system times with every packet, but I was wondering if this is also doable in java. – Albert Aug 02 '17 at 16:55
  • Okay, thanks @Andreas (and everyone). – Albert Aug 02 '17 at 16:58
  • It is doable. You can use the jnetpcap library in java and study the packets yourself. But that's not as trivial as it sounds. – f1sh Aug 02 '17 at 16:58
  • 1
    pcap-based tools can do this because they install a hook into the network drivers. Java can't do that. That is OS kernel-level programming. Java *might* be able to *use* pcap, though. If you want to follow that thought, ask another question about that. *(oh, seems there's a jnetpcap library. thanks, @f1sh)* – Andreas Aug 02 '17 at 16:58

0 Answers0