ä½ æ¯è¯´å¦ä½å¼åå ï¼ å¦ææ¯çè¯ï¼ å¯ä»¥ç¨socketæ¥éä¿¡ã
客æ·ç«¯åé请æ±ãæ¥æ¶è¯·æ± ï¼ æå¡ç«¯æ¥å请æ±ãè¿å请æ±ã
追é®è½ç»æå
·ä½çå®ç°æ¹æ³ï¼å°±æ¯å
·ä½çåæ³
追çpublic class SocketServerMain extends Thread {
private Socket client;
public SocketServerMain(Socket c) {
this.client = c;
}
//å
¥å£æ¹æ³
public static void main(String[] args) {
try {
ServerSocket server;
server = new ServerSocket(9526);
while (true) {
SocketServerMain mc = new SocketServerMain(server.accept());
mc.start();
System.out.println("æå¡ç«¯æåå¼å¯çå¬ï¼");
}
} catch (IOException e) {
e.printStackTrace();
}
}
//runæ¹æ³ å
·ä½ä»£ç ä¸é¢æ
public void run() {
}
}