Class WebSocket


  • public final class WebSocket
    extends Transport
    WebSocket transport.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doClose()
      Transport specific logic for closing transport.
      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getInitialHeaders()
      Get the headers of the initial HTTP request.
      java.util.Map<java.lang.String,​java.lang.String> getInitialQuery()
      Get the query parameters of the initial HTTP request.
      java.lang.String getName()
      Get the name of this transport.
      boolean isWritable()
      Checks whether the transport is currently writable.
      void onRequest​(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      Handle a client HTTP request.
      void send​(java.util.List<Packet<?>> packets)
      Send a list of packets over the transport.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInitialQuery

        public java.util.Map<java.lang.String,​java.lang.String> getInitialQuery()
        Description copied from class: Transport
        Get the query parameters of the initial HTTP request.
        Specified by:
        getInitialQuery in class Transport
        Returns:
        Query parameters of the initial HTTP request.
      • getInitialHeaders

        public java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getInitialHeaders()
        Description copied from class: Transport
        Get the headers of the initial HTTP request.
        Specified by:
        getInitialHeaders in class Transport
        Returns:
        Headers of the initial HTTP request.
      • onRequest

        public void onRequest​(jakarta.servlet.http.HttpServletRequest request,
                              jakarta.servlet.http.HttpServletResponse response)
        Description copied from class: Transport
        Handle a client HTTP request.
        Specified by:
        onRequest in class Transport
        Parameters:
        request - The HTTP request object.
        response - The HTTP response object.
      • send

        public void send​(java.util.List<Packet<?>> packets)
        Description copied from class: Transport
        Send a list of packets over the transport.
        Specified by:
        send in class Transport
        Parameters:
        packets - List of packets to send.
      • isWritable

        public boolean isWritable()
        Description copied from class: Transport
        Checks whether the transport is currently writable.
        Specified by:
        isWritable in class Transport
        Returns:
        Boolean value indicating if transport can be written to.
      • getName

        public java.lang.String getName()
        Description copied from class: Transport
        Get the name of this transport.
        Specified by:
        getName in class Transport
        Returns:
        Name of transport.
      • doClose

        protected void doClose()
        Description copied from class: Transport
        Transport specific logic for closing transport.
        Specified by:
        doClose in class Transport