Package lejos.remote.nxt
Class NXTCommConnector
- java.lang.Object
-
- lejos.remote.nxt.NXTCommConnector
-
- Direct Known Subclasses:
BTConnector,SocketConnector
public abstract class NXTCommConnector extends java.lang.ObjectStandard interface to connect/wait for a connection.- Author:
- andy
-
-
Constructor Summary
Constructors Constructor Description NXTCommConnector()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract booleancancel()Cancel a connection attempt.abstract NXTConnectionconnect(java.lang.String target, int mode)Open a connection to the specified name/address using the given I/O modeabstract NXTConnectionwaitForConnection(int timeout, int mode)Wait for an incoming connection, or for the request to timeout.
-
-
-
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 mademode- 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.
-
-