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.

user2363027
  • 121
  • 1
  • 6

1 Answers1

0

Apparently, this was my fault. I had opened a JDialog to get the user input and was sending the message from the JDialog before disposing of it. And, when the JDialog was disposed of, then apparently that caused the close. When I removed the write from the JDialog close method, then it closed the connection.

user2363027
  • 121
  • 1
  • 6