users@grizzly.java.net

Keep server running without using System.in.read()

From: LongkerDandy <longkerdandy_at_gmail.com>
Date: Wed, 25 Jun 2014 22:45:33 +0800

Hi


I've a TCP Server based on Grizzly, and I followed the examples start the
server with codes like:

            this.transport.bind(this.host, this.port);
            this.transport.start();
            System.in.read();

I wondered if there is a better way to keep the thread runing without using
System.in.read().
It doesn't seem to be a elegant way for this job, and easily run into
trouble with carefuless mistake.

Regards
LongkerDandy