java.net ソケットを使用してサーバーを作成しました。localhost クライアント経由でサーバーにアクセスしようとすると、要求を受け入れてクライアントに応答しますが、LAN ケーブル接続を介して別のコンピューターからリモートでアクセスしようとすると、何も受け入れません。ローカル ポート (9999) をリッスンしているにもかかわらず、ポートが機能しないかどうかを確認するために、ポート (9999) をリッスンするように Apache Web サーバーを構成し、それが機能するので、別のポートをリッスンするように設定しましたしかし、運が悪く、ファイアウォールでさまざまなポートを開こうとしても、まだ機能しません。
サーバーがリクエストを受け入れない、またはリモートクライアントからの接続を確立しない理由を誰かに説明してもらえますか?
サーバーソケット:
try {
Server = new ServerSocket(L_port);
}
catch(IOException e) {
}
while(!runServer) {
try {
incoming = Server.accept();
InputStream client;
//Create the 2 threads for the incoming and outgoing traffic of proxy server
outgoing = new Socket(R_host, R_port);
proxyThread thread1 = new proxyThread(incoming, outgoing);
thread1.start();
proxyThread thread2 = new proxyThread(outgoing, incoming);
thread2.start();
}
catch (UnknownHostException e) {
}
catch(IOException e){
}
}
nestat -an: