はじめに 今回は、JavaによるWebSocketクライアントの実装方法を解説します。 今回のサンプルでは、WebSocketクライアントを作成し、動作確認のためサーバ側の処理(Java)も実装します。 最終的にはサーバ側でクライアントから送信したメッセージが受け取れることを確認します。 以降、以下のバージョン、環境での解説となります。 フォルダ構成 今回作成するサンプルソースのフォルダ構成は以下の通りです。 プロジェクトの作成 1. WebSocketクライアントのプロジェクト作成 パッケージエクスプローラーで右クリック>新規>Javaプロジェクトを選択し、「SampleClient」というプロジェクトを作成します。 2. サーバのプロジェクト作成 パッケージエクスプローラーで右クリック>新規>その他>Web>動的Javaプロジェクトを選択し、「SampleServer」というプロジェク