1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
| package Netty;
| public class StartServer implements Runnable{
|
| boolean statrt=true;
| int tcprce=0;
|
| /**Æô¶¯Ï̵߳ķ½·¨*/
| public void startThread() {
| Thread t=new Thread(this);
| t.start();
| }
|
| public void run() {
| while(statrt) {
| try {
|
| try {
| NettyServer.server();
| statrt=false;
| } catch (Exception e) {
| // TODO ×Ô¶¯Éú³ÉµÄ catch ¿é
| e.printStackTrace();
| }//¿ªÆôTCP¼àÌý
| Thread.sleep(300);//ÐÝÃßʱ¼ä
| } catch (InterruptedException e) {
| e.printStackTrace();
| }
| }
| }
|
| }
|
|