急~~~~~F关于Java网络编程中多客户端对服务端的无法访问?
//Server.java
//////////////////////////////////////
package javanet;
import java.net.*;
import java.io.*;
public class Server {
// create a server
private ServerSocket server;
private int clientCount=0;
/** Creates a new instance of Server */
public Server() {
try {
while(true){
server=new ServerSocket(8086);
System.out.println( "正在等待客户的连接: ");
Socket connectToClient=server.accept();
clientCount++;
System.out.println( "客户 "+clientCount+ "已经连接上,服务器应答就绪: ");
HandleAClient thread=new HandleAClient(connectToClient);
thread.start();
}
}
catch(
BindException e){
System.out.println( "端口被占用 ");