Can I do low level network programming in Java?

前端 未结 3 676
半阙折子戏
半阙折子戏 2021-02-09 20:32

An application level message is send over the network in a series of packets that are assembled in the receiving side and passed to the application level.
Is it possible in

3条回答
  •  囚心锁ツ
    2021-02-09 20:59

    You won't see packetized segments if some other device breaks your large UDP packet into smaller packets.

    When reading TCP you'll read bytes as a stream. You'll have no idea how these bytes were actually sent. You could read back 100 bytes, and they could have been sent over 10 packets for all you know.

    There's no way to access this information in java without JNI. Of course with JNI you can do anything :)

提交回复
热议问题