I'm using MINA as a server to process client connections. However, my application also needs to make a client connection to a server and feed the retrieved data to a 3rd party library. The client connection will be maintained 24 hours a day, so it is important that it can reconnect automatically in case of network failure.

The 3rd party library requires an InputStream to process data. I originally attempted to use the StreamIoHandler with a SocketConnector but ran into problems and found archived messages recommending not to use this handler.

Given that the 3rd party library requires an InputStream, is MINA the appropriate choice? There is only one client connection, so non- blocking vs blocking I/O really isn't an issue. Should I simply use a socket? If not, what does MINA really offer me over a plain socket connection in this case?

The only thing I can think of is exception handling event callbacks which could assist with automatic reconnections. Of course, with the socket I can just wrap my InputStream processing and catch all IOExceptions - then attempt to reconnect after a short delay.

Any advice?

Thanks,
Jeremy Haile

Reply via email to