Share

Redstone XML-RPC Library

The forum address has changed, you have been automatically redirected. Please update any bookmarks to use the new URL.

Subscribe

Turning off hyper-printing in Simple Server

You are viewing a single message from this topic. View all messages.

  1. 2009-06-18 20:01:08 UTC
    I used the "Simple + XML-RPC" implementation of Redstone, where instead of having to hook up the system to a webserver you can just generate a makeshift java webserver.

    It has worked well for me, but one issue I had was that every time the Simple webserver received an RPC, it would print information about the call. Turns out that the current version (version 1.0) always has debug-mode turned on.

    The solution is to download the source code for the smallest JAR file, make a few changes, compile, and then JAR it into a replacement JAR. The JAR file contains two classes: Main.java and Server.java

    --------------------------------------------------

    Here are the changes:

    In Server, change the constructor to:

    public Server( int port, boolean debug ) throws Exception
    {
    address = new InetSocketAddress( port );
    connection = new SocketConnection( this );
    xmlRpcServer = new XmlRpcServer();
    if (debug) xmlRpcServer.addInvocationInterceptor( new DebugInvocationInterceptor() );
    }

    I instantiate the Simple Server programatically, so Main wasn't relevant to me. Nonetheless just for the heck of it in Main:

    Change line 58 to: server = new Server( Integer.parseInt( args[ 0 ] ), true );
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.