?? netserver_hua.java
字號:
package com.jk.test;
import java.io.*;
import java.net.*;
import java.util.*;//collection
public class NetServer_hua {
private int port = 8888;
private ServerSocket ss = null;
private Socket s = null;
private ObjectInputStream ois = null;
private Collection c = null;
public void start(){
try {
ss = new ServerSocket(port,50);//50為最大連接數(shù)
while(true){
s = ss.accept();
ois = new ObjectInputStream(s.getInputStream());
c = (Collection) ois.readObject();
new NetTread_hua(c);
ois.close();
s.close();
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
try {
ss.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
/**
* @param args
*/
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -