难道还有第3条分支???怎么判断 socket 的数据已经传输
天限天空 2002-11-21 09:40:59 try {
while (true) {
byte[] s = getNextSendObject();
if (s == null) {
} else {
int len = ((int)s[0]) | (((int)s[1])<<8) | (((int)s[2])<<16) | (((int)s[3])<<24) ;
for(int i=0;i<len;i++) System.out.print(s[i]);
System.out.println(socket.isInputShutdown()+"==okokoisClosed="+socket.isClosed()+" ==isConnected="+socket.isConnected()+" ==isInputShutdown"+socket.isOutputShutdown()+" ==getKeepAlive="+socket.getKeepAlive() );
out.write(s,0,len); out.flush();
System.out.print("ok");
}
}
} catch (IOException e) {
e.printStackTrace();
closeSocket();
} catch (Exception ep) {
ep.printStackTrace();
System.out.println("okokokokokoo!!!!!!!!!!!!!!");
}
如果打印出了 for(int i=0;i<len;i++) System.out.print(s[i]); 和 System.out.print("ok"); 没有打印出e.printStackTrace();,ep.printStackTrace(); 能够说明 out.write(s,0,len); out.flush(); 已经完成吗????
郁闷的问题,根本没发调试!!!!