Class NonBlockingServerTCPTransport

    • Constructor Detail

      • NonBlockingServerTCPTransport

        public NonBlockingServerTCPTransport​(Context context,
                                             Poller poller,
                                             SocketChannel channel,
                                             ResponseHandler responseHandler,
                                             int receiveBufferSize)
                                      throws SocketException
        Server TCP transport constructor.
        Parameters:
        context - context where transport lives in.
        poller - poller to use.
        channel - used socket channel.
        responseHandler - response handler used to process PVA headers.
        receiveBufferSize - receive buffer size.
        Throws:
        SocketException - thrown on any socket exception.
    • Method Detail

      • unregisterChannel

        public void unregisterChannel​(int sid)
        Unregister a new channel (and deallocates its handle).
        Specified by:
        unregisterChannel in interface ChannelHostingTransport
        Parameters:
        sid - SID
      • lock

        public void lock()
        Specified by:
        lock in interface Lockable
      • unlock

        public void unlock()
        Specified by:
        unlock in interface Lockable
      • send

        public void send​(ByteBuffer buffer,
                         TransportSendControl control)
        PVA connection validation request. A server sends a validate connection message when it receives a new connection. The message indicates that the server is ready to receive requests; the client must not send any messages on the connection until it has received the validate connection message from the server. No reply to the message is expected by the server. The purpose of the validate connection message is two-fold: It informs the client of the protocol version supported by the server. It prevents the client from writing a request message to its local transport buffers until after the server has acknowledged that it can actually process the request. This avoids a race condition caused by the server's TCP/IP stack accepting connections in its backlog while the server is in the process of shutting down: if the client were to send a request in this situation, the request would be lost but the client could not safely re-issue the request because that might violate at-most-once semantics. The validate connection message guarantees that a server is not in the middle of shutting down when the server's TCP/IP stack accepts an incoming connection and so avoids the race condition.
        Specified by:
        send in interface TransportSender
        Parameters:
        buffer - buffer to send.
        control - transport send control instance.
        See Also:
        TransportSender.send(java.nio.ByteBuffer, org.epics.pvaccess.impl.remote.TransportSendControl)
      • acquire

        public boolean acquire​(TransportClient client)
        Description copied from interface: Transport
        Acquires transport.
        Specified by:
        acquire in interface Transport
        Parameters:
        client - client (channel) acquiring the transport
        Returns:
        true if transport was granted, false otherwise.
      • release

        public void release​(TransportClient client)
        Description copied from interface: Transport
        Releases transport.
        Specified by:
        release in interface Transport
        Parameters:
        client - client (channel) releasing the transport
      • verified

        public void verified​(org.epics.pvdata.pv.Status status)
        Description copied from interface: Transport
        Acknowledge that transport was verified.
        Specified by:
        verified in interface Transport
        Overrides:
        verified in class NonBlockingTCPTransport
        Parameters:
        status - verification status.
      • verify

        public boolean verify​(long timeoutMs)
        Description copied from interface: Transport
        Waits (if needed) until transport is verified, i.e. verified() method is being called.
        Specified by:
        verify in interface Transport
        Overrides:
        verify in class NonBlockingTCPTransport
        Parameters:
        timeoutMs - timeout to wait for verification, infinite if 0.
        Returns:
        completion status.
      • authNZInitialize

        public void authNZInitialize​(Object data)
        Description copied from interface: Transport
        Used to initialize authNZ (select security plug-in).
        Specified by:
        authNZInitialize in interface Transport
        Parameters:
        data - any data.
      • authNZMessage

        public void authNZMessage​(org.epics.pvdata.pv.PVField data)
        Description copied from interface: Transport
        Pass data to the active security plug-in session.
        Specified by:
        authNZMessage in interface Transport
        Parameters:
        data - the data (any data), can be null.
      • aliveNotification

        public void aliveNotification()
        Description copied from interface: Transport
        Alive notification. This method needs to be called (by newly received data or beacon) at least once in this period, if not echo will be issued and if there is not response to it, transport will be considered as unresponsive.
        Specified by:
        aliveNotification in interface Transport