Class NXTCommConnector

  • Direct Known Subclasses:
    BTConnector, SocketConnector

    public abstract class NXTCommConnector
    extends java.lang.Object
    Standard interface to connect/wait for a connection.
    Author:
    andy
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      abstract boolean cancel()
      Cancel a connection attempt.
      abstract NXTConnection connect​(java.lang.String target, int mode)
      Open a connection to the specified name/address using the given I/O mode
      abstract NXTConnection waitForConnection​(int timeout, int mode)
      Wait for an incoming connection, or for the request to timeout.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NXTCommConnector

        public NXTCommConnector()
    • Method Detail

      • connect

        public abstract NXTConnection connect​(java.lang.String target,
                                              int mode)
        Open a connection to the specified name/address using the given I/O mode
        Parameters:
        target - The name or address of the device/host to connect to.
        mode - The I/O mode to use for this connection
        Returns:
        A NXTConnection object for the new connection or null if error.
      • waitForConnection

        public abstract NXTConnection waitForConnection​(int timeout,
                                                        int mode)
        Wait for an incoming connection, or for the request to timeout.
        Parameters:
        timeout - Time in ms to wait for the connection to be made
        mode - I/O mode to be used for the accepted connection.
        Returns:
        A NXTConnection object for the new connection or null if error.
      • cancel

        public abstract boolean cancel()
        Cancel a connection attempt.
        Returns:
        true if the connection attempt has been aborted.