Hi there Mina-Pros,

before discovering Mina I did the following:

I Started a Java ServerSocket to accept connections. I remembered the
accepted connection and waited for a new one. At server start i spawned a
number of Worker threads that:

- checked if data was available FROM each of the sockets FOR my application
logic.
- checked if data was available FOR one of the sockets FROM my application
logic.

Thus i put the worker thread in charge of getting data from the
socket->logic and vice versa.

Then i discovered MINA and I'd like to use it since its tested and stable
and works. But can I write a class (extending IoHandlerAdapter???) that not
only calls "messageReceived" when data is available from the Socket but also
periodically calls something like "shouldIsendSomeMessage" that can return
an Object to be processed by my protocolFilter or null if nothing is to be
sent out.

Of course i could start some threads to do exactly this, but i think it
might be wiser to use the worker threads that mina already provides for this
task. Is this possible at all? Does it make sense?

Thanks in advance...

Andi
-- 
View this message in context: 
http://www.nabble.com/How-can-I-build-a-polling-server-with-Mina--tf4855669s16868.html#a13894688
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.

Reply via email to