fm.liveswitch.DatagramSocket Class Referenceabstract

A datagram socket. More...

Public Member Functions

abstract int getMaxQueuedPackets ()
 Gets the maximum number of packets that can be queued at any given point in time. More...
 
abstract int getReceiveBufferSize ()
 Gets the current receive buffer size. More...
 
abstract int getSendBufferSize ()
 Gets the current send buffer size. More...
 
abstract void receiveAsync (fm.liveswitch.IAction3< fm.liveswitch.DataBuffer, String, Integer > onSuccess, fm.liveswitch.IAction1< java.lang.Exception > onFailure)
 Receives data asynchronously. More...
 
abstract fm.liveswitch.Error send (fm.liveswitch.DataBuffer buffer, String ipAddress, int port)
 Sends data synchronously. More...
 
abstract void setMaxQueuedPackets (int value)
 Sets the maximum number of packets that can be queued at any given point in time. More...
 
- Public Member Functions inherited from fm.liveswitch.ManagedSocket
abstract boolean bind (String ipAddress, int port, fm.liveswitch.BooleanHolder addressInUse)
 Binds the socket to a local endpoint. More...
 
abstract void close ()
 Closes the socket. More...
 
long getAdapterSpeed ()
 Gets the adapter speed. More...
 
abstract boolean getIPv6 ()
 Gets a value indicating whether the socket supports IPv6. More...
 
abstract boolean getIsClosed ()
 Gets a value indicating whether this instance is closed. More...
 
abstract String getLocalIPAddress ()
 Gets the local IP address. More...
 
abstract int getLocalPort ()
 Gets the local port. More...
 
String[] getPublicIPAddresses ()
 Gets the public IP addresses, if known. More...
 
void setAdapterSpeed (long value)
 Sets the adapter speed. More...
 
void setPublicIPAddresses (String[] value)
 Sets the public IP addresses, if known. More...
 

Protected Member Functions

 DatagramSocket ()
 
void raiseReceiveFailure (fm.liveswitch.IAction1< java.lang.Exception > callback, java.lang.Exception exception)
 Invokes the receive failure callback. More...
 
void raiseReceiveSuccess (fm.liveswitch.IAction3< fm.liveswitch.DataBuffer, String, Integer > callback, fm.liveswitch.DataBuffer buffer, String ipAddress, int port)
 Invokes the receive success callback. More...
 
- Protected Member Functions inherited from fm.liveswitch.ManagedSocket
 ManagedSocket ()
 

Detailed Description

A datagram socket.

Constructor & Destructor Documentation

◆ DatagramSocket()

fm.liveswitch.DatagramSocket.DatagramSocket ( )
protected

Member Function Documentation

◆ getMaxQueuedPackets()

abstract int fm.liveswitch.DatagramSocket.getMaxQueuedPackets ( )
abstract

Gets the maximum number of packets that can be queued at any given point in time.

Reimplemented in fm.liveswitch.UdpSocket.

◆ getReceiveBufferSize()

abstract int fm.liveswitch.DatagramSocket.getReceiveBufferSize ( )
abstract

Gets the current receive buffer size.

Reimplemented in fm.liveswitch.UdpSocket.

◆ getSendBufferSize()

abstract int fm.liveswitch.DatagramSocket.getSendBufferSize ( )
abstract

Gets the current send buffer size.

Reimplemented in fm.liveswitch.UdpSocket.

◆ raiseReceiveFailure()

void fm.liveswitch.DatagramSocket.raiseReceiveFailure ( fm.liveswitch.IAction1< java.lang.Exception >  callback,
java.lang.Exception  exception 
)
protected

Invokes the receive failure callback.

Parameters
callbackThe callback.
exceptionThe exception.

◆ raiseReceiveSuccess()

void fm.liveswitch.DatagramSocket.raiseReceiveSuccess ( fm.liveswitch.IAction3< fm.liveswitch.DataBuffer, String, Integer >  callback,
fm.liveswitch.DataBuffer  buffer,
String  ipAddress,
int  port 
)
protected

Invokes the receive success callback.

Parameters
callbackThe callback.
bufferThe buffer.
ipAddressThe IP address.
portThe port.

◆ receiveAsync()

abstract void fm.liveswitch.DatagramSocket.receiveAsync ( fm.liveswitch.IAction3< fm.liveswitch.DataBuffer, String, Integer >  onSuccess,
fm.liveswitch.IAction1< java.lang.Exception >  onFailure 
)
abstract

Receives data asynchronously.

Parameters
onSuccessThe callback to invoke on success.
onFailureThe callback to invoke on failure.

◆ send()

abstract fm.liveswitch.Error fm.liveswitch.DatagramSocket.send ( fm.liveswitch.DataBuffer  buffer,
String  ipAddress,
int  port 
)
abstract

Sends data synchronously.

Parameters
bufferThe buffer.
ipAddressThe remote IP address.
portThe remote port.

◆ setMaxQueuedPackets()

abstract void fm.liveswitch.DatagramSocket.setMaxQueuedPackets ( int  value)
abstract

Sets the maximum number of packets that can be queued at any given point in time.

Reimplemented in fm.liveswitch.UdpSocket.