Interface LogicalConnection

  • All Superinterfaces:
    org.eclipse.jetty.websocket.api.extensions.OutgoingFrames, org.eclipse.jetty.websocket.api.SuspendToken
    All Known Implementing Classes:
    AbstractWebSocketConnection

    public interface LogicalConnection
    extends org.eclipse.jetty.websocket.api.extensions.OutgoingFrames, org.eclipse.jetty.websocket.api.SuspendToken
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void disconnect()
      Terminate the connection (no close frame sent)
      org.eclipse.jetty.io.ByteBufferPool getBufferPool()
      Get the ByteBufferPool in use by the connection
      Executor getExecutor()
      Get the Executor used by this connection.
      String getId()
      Get Unique ID for the Connection
      long getIdleTimeout()
      Get the read/write idle timeout.
      IOState getIOState()
      Get the IOState of the connection.
      InetSocketAddress getLocalAddress()
      Get the local InetSocketAddress in use for this connection.
      long getMaxIdleTimeout()
      Set the maximum number of milliseconds of idleness before the connection is closed/disconnected, (ie no frames are either sent or received)
      org.eclipse.jetty.websocket.api.WebSocketPolicy getPolicy()
      The policy that the connection is running under.
      InetSocketAddress getRemoteAddress()
      Get the remote Address in use for this connection.
      boolean isOpen()
      Test if logical connection is still open
      boolean isReading()
      Tests if the connection is actively reading.
      void onLocalClose​(CloseInfo close)
      Called to indicate a close frame was successfully sent to the remote.
      void setMaxIdleTimeout​(long ms)
      Set the maximum number of milliseconds of idleness before the connection is closed/disconnected, (ie no frames are either sent or received)
      void setNextIncomingFrames​(org.eclipse.jetty.websocket.api.extensions.IncomingFrames incoming)
      Set where the connection should send the incoming frames to.
      void setSession​(WebSocketSession session)
      Associate the Active Session with the connection.
      org.eclipse.jetty.websocket.api.SuspendToken suspend()
      Suspend a the incoming read events on the connection.
      • Methods inherited from interface org.eclipse.jetty.websocket.api.extensions.OutgoingFrames

        outgoingFrame
      • Methods inherited from interface org.eclipse.jetty.websocket.api.SuspendToken

        resume
    • Method Detail

      • onLocalClose

        void onLocalClose​(CloseInfo close)
        Called to indicate a close frame was successfully sent to the remote.
        Parameters:
        close - the close details
      • disconnect

        void disconnect()
        Terminate the connection (no close frame sent)
      • getBufferPool

        org.eclipse.jetty.io.ByteBufferPool getBufferPool()
        Get the ByteBufferPool in use by the connection
        Returns:
        the buffer pool
      • getExecutor

        Executor getExecutor()
        Get the Executor used by this connection.
        Returns:
        the executor
      • getIdleTimeout

        long getIdleTimeout()
        Get the read/write idle timeout.
        Returns:
        the idle timeout in milliseconds
      • getIOState

        IOState getIOState()
        Get the IOState of the connection.
        Returns:
        the IOState of the connection.
      • getLocalAddress

        InetSocketAddress getLocalAddress()
        Get the local InetSocketAddress in use for this connection.

        Note: Non-physical connections, like during the Mux extensions, or during unit testing can result in a InetSocketAddress on port 0 and/or on localhost.

        Returns:
        the local address.
      • getMaxIdleTimeout

        long getMaxIdleTimeout()
        Set the maximum number of milliseconds of idleness before the connection is closed/disconnected, (ie no frames are either sent or received)
        Returns:
        the idle timeout in milliseconds
      • getPolicy

        org.eclipse.jetty.websocket.api.WebSocketPolicy getPolicy()
        The policy that the connection is running under.
        Returns:
        the policy for the connection
      • getRemoteAddress

        InetSocketAddress getRemoteAddress()
        Get the remote Address in use for this connection.

        Note: Non-physical connections, like during the Mux extensions, or during unit testing can result in a InetSocketAddress on port 0 and/or on localhost.

        Returns:
        the remote address.
      • isOpen

        boolean isOpen()
        Test if logical connection is still open
        Returns:
        true if connection is open
      • isReading

        boolean isReading()
        Tests if the connection is actively reading.
        Returns:
        true if connection is actively attempting to read.
      • setMaxIdleTimeout

        void setMaxIdleTimeout​(long ms)
        Set the maximum number of milliseconds of idleness before the connection is closed/disconnected, (ie no frames are either sent or received)

        This idle timeout cannot be garunteed to take immediate effect for any active read/write actions. New read/write actions will have this new idle timeout.

        Parameters:
        ms - the number of milliseconds of idle timeout
      • setNextIncomingFrames

        void setNextIncomingFrames​(org.eclipse.jetty.websocket.api.extensions.IncomingFrames incoming)
        Set where the connection should send the incoming frames to.

        Often this is from the Parser to the start of the extension stack, and eventually on to the session.

        Parameters:
        incoming - the incoming frames handler
      • setSession

        void setSession​(WebSocketSession session)
        Associate the Active Session with the connection.
        Parameters:
        session - the session for this connection
      • suspend

        org.eclipse.jetty.websocket.api.SuspendToken suspend()
        Suspend a the incoming read events on the connection.
        Returns:
        the suspend token
      • getId

        String getId()
        Get Unique ID for the Connection
        Returns:
        the unique ID for the connection