Class WebXHost

java.lang.Object
eu.ill.webx.relay.WebXHost

public class WebXHost extends Object
Provides connection to a WebXRouter or standalone WebXEngine. WebXTransport management connections to the ZMQ sockets. WebXHost manages all sessions that are in use on the host. Creation of sessions and connection/creation of clients is handled here.
  • Method Details

    • getHostname

      public String getHostname()
      Returns the hostname
      Returns:
      the hostname
    • getPort

      public int getPort()
      Returns the principal (client connector) port of the host
      Returns:
      the host port
    • onClientConnection

      public WebXClient onClientConnection(WebXClientConfiguration clientConfiguration) throws WebXConnectionException
      Called when a client connects. Depending on the connection type it will start a new session. In all cases the client is connected to WebX engine.
      Parameters:
      clientConfiguration - The client connection configuration
      Returns:
      a new WebX client
      Throws:
      WebXConnectionException - thrown if the connection fails
    • onClientDisconnected

      public void onClientDisconnected(WebXClient client)
      Called when a client disconnects. The client is disconnected in the WebX engine. The session will be removed if it is empty.
      Parameters:
      client - the WebX client
    • getClientCount

      public int getClientCount()
      Returns the total number of clients connected
      Returns:
      the number of clients connected
    • cleanupSessions

      public void cleanupSessions()
      Ensures that there are no empty sessions