?? testserver.java
字號:
package com.ec.generalserver;
import java.util.ArrayList;
import java.util.List;
public class TestServer
{
/**
* @param args
*/
public static void main(String[] args)
{
// TODO Auto-generated method stub
String ip = "127.0.0.1";
int port = 12345;
List allowip = new ArrayList();
allowip.add(new String("127.0.0.1"));
try
{
GeneralServer svr = new GeneralServer(ip,port,1,new TestAppFactory());
//每連接一個App對象關聯
svr.setAllowIP(allowip); //default all
svr.setMaxConn(100); //default no limit
svr.setConnTimeout(10); //default no limit
svr.init();
svr.run();
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -