To create a simple INDI Server is a matter of a bunch of code lines. In the following a very simple Server is coded. That server only instantiates one Driver (see Minimal INDI Driver: Random Number Generator) and only allows connections from the same machine (Inet address To do so, the Server extends the DefaultINDIServer and overrides the acceptClient(Socket socket) method.

To instantiate the Driver it is only necessary to use the loadJavaDriver(Class) method (in this case it is done at the end of the constructor). Please note that the Class of the Driver to instantiate MUST be in the classpath. If it is not in the classpath other methods might be used to load them (for example the loadJavaDriversFromJAR).


 *  This file is part of INDI for Java Server.
 *  INDI for Java Server is free software: you can redistribute it
 *  and/or modify it under the terms of the GNU General Public License 
 *  as published by the Free Software Foundation, either version 3 of 
 *  the License, or (at your option) any later version.
 *  INDI for Java Server is distributed in the hope that it will be
 *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty
 *  GNU General Public License for more details.
 *  You should have received a copy of the GNU General Public License
 *  along with INDI for Java Server.  If not, see 
 *  <>.
package laazotea.indi.server.examples;
import laazotea.indi.INDIException;
import laazotea.indi.driver.examples.RandomNumberGeneratorDriver;
import laazotea.indi.server.DefaultINDIServer;
 * An almost minimum INDI Server. It just has one working Driver:
 * RandomNumberGeneratorDriver (please check the INDI for Java Driver examples)
 * and it only accepts connections from (localhost).
 * @author S. Alonso (Zerjillo) [zerjio at]
 * @version 1.21, April 4, 2012
public class MinimumINDIServer extends DefaultINDIServer {
   * Just loads the available driver.
  public MinimumINDIServer() {
    // Loads the Java Driver. Please note that its class must be in the classpath.
    try {
    } catch (INDIException e) {
   * Accepts the client if it is (localhost).
   * @param socket
   * @return
  protected boolean acceptClient(Socket socket) {
    byte[] address = socket.getInetAddress().getAddress();
    if ( (address[0] == 127) && (address[1] == 0) && (address[2] == 0) && (address[3] == 1) ) {
      return true;
    return false;
   * Just creates one instance of this server.
   * @param args 
  public static void main(String[] args) {
    MinimumINDIServer s = new MinimumINDIServer();