日期:2014-05-20 浏览次数:20648 次
private void service(){
while(true){
Socket socket = null;
DataInputStream input = null;
try{
socket = sslServerSocket.accept();
input = SocketIO.getDataInput(socket);
throws new Exception("exception");
}catch(Exception e){
if(null != socket){
try {
DataOutputStream output = SocketIO.getDataOutput(socket);
String result = e.getMessage();
output.write(result.getBytes("utf-8"));
} catch (Exception e1) {
e1.printStackTrace();
logger.error("socket send message error!");
} finally{
if(null != socket){
try {
socket.close();
} catch (IOException e1) {
e1.printStackTrace();
logger.error("socket close error!");
}
}
}
}
}
}
}