Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ソケットを使用して相互に通信する2つのエアアプリケーションがあります。
アプリ1のコード
socket.writeUnsignedInt(4);
アプリ2のコード
socket.readUnsignedInt();
readInt()の結果が「4」(送信したint)になることを期待していますが、「262144」が返されます。
どんな助けでも大歓迎です。
16進数の262144値は00 04 00 00、ストリームが同期していない可能性があります。つまり、readUnsignedInt()呼び出す前にストリームから読み取るバイト数が少なすぎます。
00 04 00 00
readUnsignedInt()