The server: EJServer

The EJServer is a complete TCP/IP based network server, which can be used either for setting up new client/server applications or for integration into existing applications. It offers support for:

  • Java non-blocking IO (java.nio)
  • Java stream-oriented IO (java.io)
  • persistent as well as non-persitent connections
  • selective compression of data
  • scalable multithreading
  • Usage of all processor cores on multiprocessor systems
  • HTTP protocoll (partially)
  • partial reading/writing of data without process blocking
  • automatic monitoring of I/O processes with reactivation/restart of "dead" processes

Creating the server

A server is an instance of de.netseeker.ejoe.EJServer . The instance must be created by using one of the offered constructors:
  • EJServer()
    Creates a new instance of EJServer, pre-configured with the settings out of the file "ejserver.properties", which has to be able on the classpath.
  • EJServer(Properties properties)
    Creates a new instance of EJServer, pre-configured with the passed settings. This constructor can be used, if the settings for EJServer were already read from another configuration file...
  • EJServer(String pathToConfigFile)
    Creates a new instance of EJServer, pre-configured with the settings out of the given file.
  • EJServer(ServerHandler handler)
    Creates a new instance of EJServer, pre-configured with default settings and the passed ServerHandler.
  • EJServer(ServerHandler handler, int port)
    Creates a new instance of EJServer using default settings as well as the passed ServerHandler. The server will listen to the passed port instead of the default port (12577).
  • EJServer(ServerHandler handler, String bindAddr)
    Creates a new instance of EJServer using default settings as well as the passed ServerHandler. The server will bind itself to the network interface specified by the passed binding address, eg. "127.0.0.1" or "81.209.148.146".
  • EJServer(ServerHandler handler, String bindAddr, int port)
    Creates a new instance of EJServer using default settings as well as the passed ServerHandler. The server will bind itself to the network interface specified by the passed binding address, eg. "127.0.0.1" or "81.209.148.146". The server will listen on the passed port instead of the default port (12577).