Class VertxWebsocketHost


  • public class VertxWebsocketHost
    extends Object
    A Vert.x backed WebSocket host bound to a specified host & port
    • Method Detail

      • connect

        public void connect​(VertxWebsocketConsumer consumer)
        Sets up a Vert.x route and handler for the WebSocket path specified by the consumer configuration
      • disconnect

        public void disconnect​(String path)
        Removes the Vert.x route and handler for the WebSocket path specified by the consumer configuration
      • start

        public void start()
                   throws Exception
        Starts a Vert.x HTTP server to host the WebSocket router
        Throws:
        Exception
      • getConnectedPeers

        public Map<String,​io.vertx.core.http.ServerWebSocket> getConnectedPeers()
        Gets all WebSocket peers connected to the Vert.x HTTP sever together with their associated connection key
      • getPort

        public int getPort()
        Gets the port that the server is bound to. This could be a random value if 0 was specified as the initial port number
      • isManagedHost

        public boolean isManagedHost​(String host)
        Determines whether the specified host name is one that is managed by this host.
      • isManagedPort

        public boolean isManagedPort​(int port)
        Determines whether the specified port is one that is managed by this host.