?? serverlistenthread.java
字號:
package smgpgw;
import java.net.*;
/**
* Title: Mirco-Payment Platform
* Description: this is an Micro-Payment Platform implementation based on China Mobile's Micro-Payment Platform draft December, 2001
* Copyright: Copyright (c) 2001
* Company: talkweb
* @author wangpei
* @version 1.0
*/
public class ServerListenThread extends Thread {
private ServerSocket mysvrsock;
public ServerListenThread(ServerSocket svrsocket) {
mysvrsock = svrsocket;
}
public void run() {
try {
while(true) {
Socket smppSocket = mysvrsock.accept();
try {
SMSCConnection sc = new SMSCConnection(smppSocket);
Thread scThread = new Thread (sc);
scThread.start() ;
} catch(Exception e) {
SMSCFrame.RecvArea.append("Create SMSC connection failed, exception : " +
e.getMessage() + "\n");
smppSocket.close();
}
}
// end while
}
catch(Exception exx) {
try {
mysvrsock.close();
} catch(Exception exxx) {}
;
SMSCFrame.RecvArea.append("Create SMSC connection failed, exception : " +
exx.getMessage() + "\n");
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -