Package com.jme3.network.kernel
Interface Connector
- All Known Implementing Classes:
- SocketConnector,- UdpConnector
public interface Connector
A single channel remote connection allowing the sending
  and receiving of data.  As opposed to the Kernel, this will
  only ever receive data from one Endpoint and so bypasses
  the envelope wrapping.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturns true if there is currently data available for reading.voidclose()Closes the connection.booleanReturns true if this connector is currently connected.read()Reads a chunk of data from the connection, blocking if there is no data available.voidwrite(ByteBuffer data) Writes a chunk of data to the connection from data.position() to data.limit().
- 
Method Details- 
isConnectedboolean isConnected()Returns true if this connector is currently connected.
- 
closevoid close()Closes the connection. Any subsequent attempts to read or write will fail with an exception.
- 
availableboolean available()Returns true if there is currently data available for reading. Some connector implementations may not be able to answer this question accurately and will always return false.
- 
readByteBuffer read()Reads a chunk of data from the connection, blocking if there is no data available. The buffer may only be valid until the next read() call is made. Callers should copy the data if they need it for longer than that.- Returns:
- The data read or null if there is no more data because the connection is closed.
 
- 
writeWrites a chunk of data to the connection from data.position() to data.limit().
 
-