Class WsRemoteEndpointImplBase

    • Field Detail

      • SENDRESULT_OK

        protected static final SendResult SENDRESULT_OK
      • messagePartInProgress

        protected final Semaphore messagePartInProgress
    • Constructor Detail

      • WsRemoteEndpointImplBase

        public WsRemoteEndpointImplBase()
    • Method Detail

      • setTransformation

        protected void setTransformation​(Transformation transformation)
      • getSendTimeout

        public long getSendTimeout()
      • setSendTimeout

        public void setSendTimeout​(long timeout)
      • sendStringByCompletion

        public void sendStringByCompletion​(String text,
                                           SendHandler handler)
      • getSendWriter

        public Writer getSendWriter()
      • acquireMessagePartInProgressSemaphore

        protected boolean acquireMessagePartInProgressSemaphore​(byte opCode,
                                                                long timeoutExpiry)
                                                         throws InterruptedException
        Acquire the semaphore that allows a message part to be written.
        Parameters:
        opCode - The OPCODE for the message to be written
        timeoutExpiry - The time when the attempt to acquire the semaphore should expire
        Returns:
        true if the semaphore is obtained, otherwise false.
        Throws:
        InterruptedException - If the wait for the semaphore is interrupted
      • updateStats

        protected void updateStats​(long payloadLength)
        Hook for updating server side statistics. Called on every frame written (including when batching is enabled and the frames are buffered locally until the buffer is full or is flushed).
        Parameters:
        payloadLength - Size of message payload
      • sendObjectByCompletion

        public void sendObjectByCompletion​(Object obj,
                                           SendHandler completion)
      • setSession

        protected void setSession​(WsSession wsSession)
      • close

        public final void close()
      • doWrite

        protected abstract void doWrite​(SendHandler handler,
                                        long blockingWriteTimeoutExpiry,
                                        ByteBuffer... data)
      • isMasked

        protected abstract boolean isMasked()
      • doClose

        protected abstract void doClose()
      • getLock

        protected abstract Lock getLock()