Class AbstractCodec

    • Field Detail

      • logger

        protected final Logger logger
      • socketBuffer

        protected final ByteBuffer socketBuffer
      • version

        protected byte version
      • flags

        protected byte flags
      • command

        protected byte command
      • payloadSize

        protected int payloadSize
      • sendBuffer

        protected final ByteBuffer sendBuffer
      • remoteTransportSocketReceiveBufferSize

        protected int remoteTransportSocketReceiveBufferSize
        Remote side transport socket receive buffer size.
      • totalBytesSent

        protected long totalBytesSent
        Total bytes sent.
      • blockingProcessQueue

        protected final boolean blockingProcessQueue
      • writeOpReady

        protected boolean writeOpReady
    • Constructor Detail

      • AbstractCodec

        public AbstractCodec​(boolean serverFlag,
                             ByteBuffer receiveBuffer,
                             ByteBuffer sendBuffer,
                             int socketSendBufferSize,
                             boolean blockingProcessQueue,
                             Logger logger)
    • Method Detail

      • processControlMessage

        public abstract void processControlMessage()
      • processApplicationMessage

        public abstract void processApplicationMessage()
                                                throws IOException
        Throws:
        IOException
      • getLastReadBufferSocketAddress

        public abstract InetSocketAddress getLastReadBufferSocketAddress()
      • invalidDataStreamHandler

        public abstract void invalidDataStreamHandler()
      • ensureData

        public final void ensureData​(int size)
      • alignedValue

        public static final int alignedValue​(int value,
                                             int alignment)
      • alignData

        public void alignData​(int alignment)
      • alignBuffer

        public void alignBuffer​(int alignment)
        Specified by:
        alignBuffer in interface org.epics.pvdata.pv.SerializableControl
      • putControlMessage

        public final void putControlMessage​(byte command,
                                            int data)
      • ensureBuffer

        public final void ensureBuffer​(int size)
        Specified by:
        ensureBuffer in interface org.epics.pvdata.pv.SerializableControl
      • flushSerializeBuffer

        public void flushSerializeBuffer()
        Specified by:
        flushSerializeBuffer in interface org.epics.pvdata.pv.SerializableControl
      • send

        protected void send​(ByteBuffer buffer)
                     throws IOException
        Send a buffer through the transport. NOTE: TCP sent buffer/sending has to be synchronized (not done by this method).
        Parameters:
        buffer - buffer to be sent
        Throws:
        IOException - IO exception rethrown.
      • sendBufferFull

        protected abstract void sendBufferFull​(int tries)
                                        throws IOException
        Throws:
        IOException
      • scheduleSend

        public abstract void scheduleSend()
      • sendCompleted

        public abstract void sendCompleted()
      • clearSendQueue

        public final void clearSendQueue()
      • enqueueSendRequest

        public final void enqueueSendRequest​(TransportSender sender)
      • setSenderThread

        public void setSenderThread()
      • enqueueSendRequest

        public final void enqueueSendRequest​(TransportSender sender,
                                             int requiredBufferSize)
      • setByteOrder

        public void setByteOrder​(ByteOrder byteOrder)
      • terminated

        public abstract boolean terminated()