You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Marc Anthony Winoto <ma...@netregistry.com.au> on 2006/08/10 09:25:06 UTC
[mina] Must I create my own threads?
I have read the Mina online tut and got my own simple client-server setup. It's pretty much a
copy of the echo example.
When I run the server, it exits the main method and never spends any time listening. If I put in
infinite loop at the end of the main method and start the client, we can see that the setup int
the server main() was correct.
I tried running the examples and I get the same result: setup the server, print out listening
port, exit.
Am I supposed to create a new thread and call some method which blocks or something?
Very confused
Thanks
Marc
Re: [mina] Must I create my own threads?
Posted by peter royal <pr...@apache.org>.
(cc'ing mina-dev, since mina has its own list now)
On Aug 10, 2006, at 3:25 AM, Marc Anthony Winoto wrote:
> I have read the Mina online tut and got my own simple client-server
> setup. It's pretty much a copy of the echo example.
>
> When I run the server, it exits the main method and never spends
> any time listening. If I put in infinite loop at the end of the
> main method and start the client, we can see that the setup int the
> server main() was correct.
>
> I tried running the examples and I get the same result: setup the
> server, print out listening port, exit.
>
> Am I supposed to create a new thread and call some method which
> blocks or something?
That's one way.
Another way is to use the ExecutorThreadPool in the java5 module in
svn. Since by default its threads are non-daemon, it will be enough
to keep the JVM alive.
-pete
--
proyal@apache.org - http://fotap.org/~osi