public void run ( ) { try { ServerSocket serverSocket = new ServerSocket ( url . getPort ( ) ) ; while ( true ) { // Create one script per socket connection. // This is purposefully not caching the Script // so that the script source file can be changed on the fly, // as each connection is made to the server. //FIXME: Groovy has other mechanisms specifically for watching to see if source code changes. // We should probably be using that here. // See also the comment about the fact we recompile a script that can't change. Script script = groovy . parse ( source ) ; new GroovyClientConnection ( script , autoOutput , serverSocket . accept ( ) ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } }
Runs this server . There is typically no need to call this method as the object s constructor creates a new thread and runs this object automatically .