2
votes

I am using MINA 2.0.0 M6 and there are lots of exceptions as follows in the log file.

In my application, nothing should be sent to the client from MINA as every client that connects will send only its GPS data every x minutes. One device was set to keep transferring data to my server. However, I found that the MINA server randomly cannot get data from client. Like, server side create a session for new connection, however, for some reason server cannot get data and then throw IOExeception and close the session after 10 minnutes which is set by MINA timeout.

I am sure that the device is running normally and keep sending data. MINA also seems OK as server can get data most times. It let me think that there may be some setting in the Apache Mina for the connection number. Can anyone help me the fix this problem.

By the way, I also check the maximun number of Linux server TCP connection number.

*****************************************************************************
java.io.IOException: Connection reset by peer at sun.nio.ch.FileDispatcher.read0(Native Method) at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:21) at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:202) at sun.nio.ch.IOUtil.read(IOUtil.java:175) at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:243)

1

1 Answers

1
votes

First of all there is no restriction from MINA on number of connections. And This is not a MINA specific problem. This occurs when the peer client resets the connection in middle of conversation. It's just an information that a client has quit brutally. It is very common case with the devices sending data using GPRS. So, it is not really a problem at server side and ts best to clean resources in this scenario, if you have kept any stuff related to the Client there. There is nothing to fix here, except logging less.