📄 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 + -