Class WebSocketServer

    • Constructor Detail

      • WebSocketServer

        public WebSocketServer​(WebSocketServerParameters wssParameters)
                        throws com.kristensoft.kdc.license.runtime.LicenseException
        Creates a WebSocket server using the specified parameters.
        Parameters:
        wssParameters - the WebSocket server configuration parameters
        Throws:
        com.kristensoft.kdc.license.runtime.LicenseException - if the server cannot be created because of a licensing error
    • Method Detail

      • run

        public void run()
        Starts the Jetty WebSocket server and waits for it to terminate.

        After the Jetty server is started, the current thread waits until the server has stopped.

        Specified by:
        run in interface Runnable
        Specified by:
        run in class Server
      • close

        public void close()
        Stops the underlying Jetty WebSocket server.

        If the Jetty server has not been created, this method has no effect. Errors encountered while stopping the server are logged.

        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in class Server
      • isRunning

        public boolean isRunning()
        Determines whether this communication entity is currently running.
        Returns:
        true if this communication entity is running; false otherwise
      • flushMetrics

        public void flushMetrics()
        Flushes the accumulated latency metrics for this communication entity.

        This method may be used to report any currently accumulated metrics without waiting for the configured latency reporting interval.

      • getAgentSerializer

        public AgentSerializer getAgentSerializer()
        Returns the agent serializer used by this communication entity.

        The serializer may be used to inspect or modify serialization settings at runtime, including compression and encryption settings.

        Returns:
        the agent serializer used by this communication entity