com.jme3.network.kernel.tcp
クラス SocketConnector

java.lang.Object
  上位を拡張 com.jme3.network.kernel.tcp.SocketConnector
すべての実装されたインタフェース:
Connector

public class SocketConnector
extends java.lang.Object
implements Connector

A straight forward socket-based connector implementation that does not use any separate threading. It relies completely on the buffering in the OS network layer.


コンストラクタの概要
SocketConnector(java.net.InetAddress address, int port)
           
 
メソッドの概要
 boolean available()
          Returns true if there is currently data available for reading.
 void close()
          Closes the connection.
 boolean isConnected()
          Returns true if this connector is currently connected.
 java.nio.ByteBuffer read()
          Reads a chunk of data from the connection, blocking if there is no data available.
 void write(java.nio.ByteBuffer data)
          Writes a chunk of data to the connection from data.position() to data.limit().
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

SocketConnector

public SocketConnector(java.net.InetAddress address,
                       int port)
                throws java.io.IOException
例外:
java.io.IOException
メソッドの詳細

isConnected

public boolean isConnected()
インタフェース Connector の記述:
Returns true if this connector is currently connected.

定義:
インタフェース Connector 内の isConnected

close

public void close()
インタフェース Connector の記述:
Closes the connection. Any subsequent attempts to read or write will fail with an exception.

定義:
インタフェース Connector 内の close

available

public boolean available()
インタフェース Connector の記述:
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.

定義:
インタフェース Connector 内の available

read

public java.nio.ByteBuffer read()
インタフェース Connector の記述:
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.

定義:
インタフェース Connector 内の read
戻り値:
The data read or null if there is no more data because the connection is closed.

write

public void write(java.nio.ByteBuffer data)
インタフェース Connector の記述:
Writes a chunk of data to the connection from data.position() to data.limit().

定義:
インタフェース Connector 内の write