0

I have a MINA program that uses NioSocketConnector (client) and NioSocketAdapter (server). Both of these work except when the NioSocketConnector needs to write a response back to the server. When I attempt to write, I have about a 50/50 shot of the connection shutting down immediately after I do the ioSession.write(message). If I comment out the ioSession.write(message), then 100% of the time, the message gets through.

At first I thought it was a matter of the message--perhaps it was too long or had some kind of magical string, but even short messages getting written out cause the connection to end.

No exceptions are caught and none are getting swallowed. Everything is going out to the console and to the log4j log, which is set to DEBUG.

Right now I'm just curious if anyone else has had this problem.

4

1 回答 1

0

显然,这是我的错。我打开了一个 JDialog 来获取用户输入,并在处理之前从 JDialog 发送消息。而且,当 JDialog 被处理掉时,显然这导致了关闭。当我从 JDialog 关闭方法中删除写入时,它关闭了连接。

于 2013-05-23T19:30:56.123 回答