com.jme3.network.kernel.udp
クラス UdpConnector

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

public class UdpConnector
extends java.lang.Object
implements Connector

A straight forward datagram socket-based UDP connector implementation.


コンストラクタの概要
UdpConnector(java.net.InetAddress remote, int remotePort)
          Creates a new UDP connection that send datagrams to the specified address and port.
 
メソッドの概要
 boolean available()
          This always returns false since the simple DatagramSocket usage cannot be run in a non-blocking way.
 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
 

コンストラクタの詳細

UdpConnector

public UdpConnector(java.net.InetAddress remote,
                    int remotePort)
             throws java.io.IOException
Creates a new UDP connection that send datagrams to the specified address and port.

例外:
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()
This always returns false since the simple DatagramSocket usage cannot be run in a non-blocking way.

定義:
インタフェース 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