question: public UnicastThread ( int port ) throws IOException { super ( "unicast request" ) ; setDaemon ( true ) ; if ( port == 0 ) { try { listen = new ServerSocket ( Constants . getDiscoveryPort ( ) ) ; } catch ( IOException e ) { logger . log ( Levels . HANDLED , "failed to bind to default port" , e ) ; } } if ( listen == null ) { listen = new ServerSocket ( port ) ; } this . port = listen . getLocalPort ( ) ; }
target:  Create a daemon thread.  Set up the socket now rather than in run, so that we get any exception up front.