我有一个使用套接字连接到服务器的客户端。有时下面的写对象方法会挂起。你有什么想法吗?
public void writeObject(Object obj) throws IOException, NullPointerException {
if(obj instanceof CMSRequestMessage)
CMSLogger.interfaceDebugLogger.info("Starting Method writeObject for transID ["
+ ((CMSRequestMessage)obj).getTransID() + "] ");
objectOutputStream.writeObject(obj);
objectOutputStream.flush();
objectOutputStream.reset();
CMSLogger.interfaceDebugLogger.info("End Method writeObject for transID ["
+ ((CMSRequestMessage)obj).getTransID() + "] "); // never reaches here
}