[常见FAQ] [提问]websphere 6.1 new Socket 居然要4.5s ?
hurricane88
2008-06-23
代码片段:
long k=System .currentTimeMillis(); // 创建socket socket = new java.net.Socket(connectParam.getIp(), connectParam.getPort()); socket.setSoTimeout(connectParam.getConnectTimeoutMillSeconds()); socket.setTcpNoDelay(connectParam.isTcpNoDelay()); long j=System.currentTimeMillis(); CommonLogger.info("与建立连接的时间********:" + (j-k)); 日志片段1: [2008-06-23 10:26:51,921] com.forms.platform.log.CommonLogger INFO - 一笔报文执行时间 *************************************************1812 [2008-06-23 10:26:51,937] com.forms.platform.log.CommonLogger [2008-06-23 10:26:52,984] com.forms.platform.log.CommonLogger INFO - 与雁联建立连接的时间********:4500 日志片段2: [2008-06-23 10:27:32,343] com.forms.platform.log.CommonLogger INFO - 与雁联建立连接的时间********:4500 [2008-06-23 10:27:32,343] com.forms.platform.log.SocketLog INFO - Name:test Thread:2008-06-23 10:27:274796 message: [ sendr data:000014xxxsssssssssss] 我在同一服务器上安装一tomcat然后运行却很快,建立socket耗时不到0.02s,不知道是何原因? |
|
wangxin200600
2010-03-17
怎样解决这个问题呢?我今天也遇到这个问题了
|