I'd like to send some data from C++ to Java via TCP.
On Java, I will use ByteBuffer to get receiced data. When bytebuffer.getInt(), I' like to get int data which is sent on C++.
To do this, how do I convert data on C++.
I'd like to send some data from C++ to Java via TCP.
On Java, I will use ByteBuffer to get receiced data. When bytebuffer.getInt(), I' like to get int data which is sent on C++.
To do this, how do I convert data on C++.
Convert it into network byte order using htons()
, htonl()
, etc, and receive it with ByteBuffer
or DataInputStream
.