Commit e8a25b29 by s_guodong

代码整理

parent 1689dc97
......@@ -56,7 +56,6 @@ public class ShortSocketHandle implements Runnable {
}
public void handleWithHead() {
byte[] headLenBytes = new byte[head_len];
int headLen = 0;
......@@ -80,7 +79,6 @@ public class ShortSocketHandle implements Runnable {
headLen = headLen + body_offset;
byte[] databuffer = new byte[headLen];
IOUtils.readFully(socket.getInputStream(), databuffer);
// logger.debug("socket接收");
Context context = new Context();
context.addVariable("transaction", "__val", databuffer);
ResultMsg resultMsg = new Client().call(context, interfaceName, transName, args);
......@@ -108,10 +106,10 @@ public class ShortSocketHandle implements Runnable {
IOUtils.write(header, socket.getOutputStream());
IOUtils.write(returnBytes, socket.getOutputStream());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
logger.error(e.getMessage(), e);
IOUtils.closeQuietly(socket);
} finally {
IOUtils.closeQuietly(socket);
......
......@@ -21,7 +21,7 @@ import java.util.concurrent.ExecutorService;
/**
* @author hujun
*
* <p>
* socket原生模式 ------------modified by weicong on 2016/4/01 -----------
* 兼容sslsocketserver
*/
......@@ -99,47 +99,6 @@ public class SocketServerMode implements IServerMode {
this.logger = logger;
}
/*
* public static class Builder { private Logger logger;
*
* private String trustips; // 信任的IP列表 private int port; private int
* queueLen; private int size; private String delayTime; private String
* interfaceName; private String transName; private int timeout; private
* String expression; private Object[] args; private String serverId;
*
* public Builder(int port, int queueLen, int size) { this.port = port;
* this.queueLen = queueLen; this.size = size; }
*
* public Builder setTrustips(String trustips) { this.trustips = trustips;
* return this; }
*
* public Builder setDelayTime(String delayTime) { this.delayTime =
* delayTime; return this; }
*
* public Builder setInterfaceName(String interfaceName) {
* this.interfaceName = interfaceName; return this; }
*
* public Builder setExpression(String expression) { this.expression =
* expression; return this; }
*
* public Builder setTimeout(int timeout) { this.timeout = timeout; return
* this; }
*
* public Builder setTransName(String transName) { this.transName =
* transName; return this; }
*
* public Builder setArgs(Object[] args) { this.args = args; return this; }
*
* public Builder setServerId(String serverId) { this.serverId = serverId;
* return this; }
*
* public Builder setLogger(Logger logger) { this.logger = logger; return
* this; }
*
* public SocketServerMode build() { return new SocketServerMode(this); }
*
* }
*/
@Override
public void startup() {
......@@ -164,11 +123,6 @@ public class SocketServerMode implements IServerMode {
if (mode.equals(SocketProxyFactry.ORG_SOCKET_TYPE)) {
if (DateUtil.isDateValid(expression)) {
executorService.submit(new SocketClient(interfaceName, transName, socket, args));
// counter.incConnectionCount();
// logger.info("Connection count: " +
// counter.getConnCount());
// logger.debug("result:" +
// future.get().getContent());
} else {
logger.debug("time is invalid.");
IOUtils.closeQuietly(socket);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment