Class SocketBasedConnector

    • Constructor Detail

      • SocketBasedConnector

        public SocketBasedConnector​(java.util.concurrent.ScheduledExecutorService executor,
                                    MenuCommandProtocol protocol,
                                    java.lang.String remoteHost,
                                    int remotePort)
    • Method Detail

      • start

        public void start()
        Description copied from interface: RemoteConnector
        Starts the communication channel, so it will attempt to connect with the configured device
      • stop

        public void stop()
        Description copied from interface: RemoteConnector
        Stops the library and attempts to also stop any threads and other resources associated.
      • getAtLeastBytes

        protected void getAtLeastBytes​(java.nio.ByteBuffer inputBuffer,
                                       int len)
                                throws java.io.IOException
        Description copied from class: StreamRemoteConnector
        Reads at least the number of bytes requested waiting if need be for more data.
        Specified by:
        getAtLeastBytes in class StreamRemoteConnector
        Parameters:
        inputBuffer - the buffer to read from
        len - the minimum number of bytes needed
        Throws:
        java.io.IOException - if there are problems reading.
      • sendInternal

        protected void sendInternal​(java.nio.ByteBuffer outputBuffer)
                             throws java.io.IOException
        Description copied from class: StreamRemoteConnector
        performs a send of all bytes in the output buffer until the output buffer is empty
        Specified by:
        sendInternal in class StreamRemoteConnector
        Parameters:
        outputBuffer - the buffer data to be sent
        Throws:
        java.io.IOException - if there are problems writing
      • getConnectionName

        public java.lang.String getConnectionName()
        Description copied from interface: RemoteConnector
        Gets the name of this connector locally