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.
サーバーソケットを介して整数値を送信するにはどうすればよいですか?文字列の送信は、MDNチュートリアルでカバーされているため、かなり簡単です。
文字列、XML、またはその他の任意の形式に変換できます。または、整数のバイトだけを送信する場合は、次のように整数をバイト配列に変換できます。
BitConverter.GetBytes(integer);
ただし、これを行う場合は、通信の両端のバイト順序(ビッグエンディアンとリトルエンディアン)に注意する必要があります。
それを文字列に変換するのはどうですか、そして最終的にはほとんどバイト配列を送信します