fm.liveswitch.UdpSocket Class Reference

Public Member Functions

int getReceiveBufferSize ()
 Gets the current receive buffer size. More...
 
int getSendBufferSize ()
 Gets the current send buffer size. More...
 
 UdpSocket (boolean ipv6)
 
 UdpSocket (boolean ipv6, int sendBufferSize, int receiveBufferSize)
 
boolean getIPv6 ()
 Gets a value indicating whether the socket supports IPv6. More...
 
boolean getIsClosed ()
 Gets a value indicating whether this instance is closed. More...
 
String getLocalIPAddress ()
 Gets the local IP address. More...
 
int getLocalPort ()
 Gets the local port. More...
 
void setMaxQueuedPackets (int maxQueuedPackets)
 Sets the maximum number of packets that can be queued at any given point in time. More...
 
int getMaxQueuedPackets ()
 Gets the maximum number of packets that can be queued at any given point in time. More...
 
boolean bind (String ipAddress, int port, BooleanHolder addressInUse)
 
void receiveAsync (final IAction3< DataBuffer, String, Integer > onSuccess, final IAction1< Exception > onFailure)
 
Error send (DataBuffer buffer, String ipAddress, int port)
 
void close ()
 Closes the socket. More...
 
- Public Member Functions inherited from fm.liveswitch.DatagramSocket
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...
 
- 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...
 
long getAdapterSpeed ()
 Gets the adapter speed. 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...
 

Static Public Member Functions

static int getDefaultSendBufferSize ()
 Gets the default socket send buffer size. More...
 
static void setDefaultSendBufferSize (int value)
 Sets the default socket send buffer size. More...
 
static int getDefaultReceiveBufferSize ()
 Gets the default socket receive buffer size. More...
 
static void setDefaultReceiveBufferSize (int value)
 Sets the default socket receive buffer size. More...
 
static boolean getAttemptDscp ()
 Determine whether sockets will attempt to use DSCP. More...
 
static void setAttemptDscp (boolean dscp)
 Set whether sockets will attempt to use DSCP. More...
 

Additional Inherited Members

- Protected Member Functions inherited from fm.liveswitch.DatagramSocket
 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 ()
 

Constructor & Destructor Documentation

◆ UdpSocket() [1/2]

fm.liveswitch.UdpSocket.UdpSocket ( boolean  ipv6)

◆ UdpSocket() [2/2]

fm.liveswitch.UdpSocket.UdpSocket ( boolean  ipv6,
int  sendBufferSize,
int  receiveBufferSize 
)

Member Function Documentation

◆ bind()

boolean fm.liveswitch.UdpSocket.bind ( String  ipAddress,
int  port,
BooleanHolder  addressInUse 
)

◆ close()

void fm.liveswitch.UdpSocket.close ( )

Closes the socket.

Reimplemented from fm.liveswitch.ManagedSocket.

◆ getAttemptDscp()

static boolean fm.liveswitch.UdpSocket.getAttemptDscp ( )
static

Determine whether sockets will attempt to use DSCP.

Default is false. You must "opt-in".

◆ getDefaultReceiveBufferSize()

static int fm.liveswitch.UdpSocket.getDefaultReceiveBufferSize ( )
static

Gets the default socket receive buffer size.

Defaults to 65536. A negative value indicates that the receive buffer size will not be set.

Returns
The default socket receive buffer size.

◆ getDefaultSendBufferSize()

static int fm.liveswitch.UdpSocket.getDefaultSendBufferSize ( )
static

Gets the default socket send buffer size.

Defaults to 65536. A negative value indicates that the send buffer size will not be set.

Returns
The default socket send buffer size.

◆ getIPv6()

boolean fm.liveswitch.UdpSocket.getIPv6 ( )

Gets a value indicating whether the socket supports IPv6.

Reimplemented from fm.liveswitch.ManagedSocket.

◆ getIsClosed()

boolean fm.liveswitch.UdpSocket.getIsClosed ( )

Gets a value indicating whether this instance is closed.

Reimplemented from fm.liveswitch.ManagedSocket.

◆ getLocalIPAddress()

String fm.liveswitch.UdpSocket.getLocalIPAddress ( )

Gets the local IP address.

Reimplemented from fm.liveswitch.ManagedSocket.

◆ getLocalPort()

int fm.liveswitch.UdpSocket.getLocalPort ( )

Gets the local port.

Reimplemented from fm.liveswitch.ManagedSocket.

◆ getMaxQueuedPackets()

int fm.liveswitch.UdpSocket.getMaxQueuedPackets ( )

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

Reimplemented from fm.liveswitch.DatagramSocket.

◆ getReceiveBufferSize()

int fm.liveswitch.UdpSocket.getReceiveBufferSize ( )

Gets the current receive buffer size.

Returns
The current receive buffer size.

Reimplemented from fm.liveswitch.DatagramSocket.

◆ getSendBufferSize()

int fm.liveswitch.UdpSocket.getSendBufferSize ( )

Gets the current send buffer size.

Returns
The current send buffer size.

Reimplemented from fm.liveswitch.DatagramSocket.

◆ receiveAsync()

void fm.liveswitch.UdpSocket.receiveAsync ( final IAction3< DataBuffer, String, Integer >  onSuccess,
final IAction1< Exception >  onFailure 
)

◆ send()

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

◆ setAttemptDscp()

static void fm.liveswitch.UdpSocket.setAttemptDscp ( boolean  dscp)
static

Set whether sockets will attempt to use DSCP.

Default is false. You must "opt-in".

◆ setDefaultReceiveBufferSize()

static void fm.liveswitch.UdpSocket.setDefaultReceiveBufferSize ( int  value)
static

Sets the default socket receive buffer size.

Defaults to 65536. A negative value indicates that the receive buffer size will not be set.

Parameters
valueThe default socket receive buffer size.

◆ setDefaultSendBufferSize()

static void fm.liveswitch.UdpSocket.setDefaultSendBufferSize ( int  value)
static

Sets the default socket send buffer size.

Defaults to 65536. A negative value indicates that the send buffer size will not be set.

Parameters
valueThe default socket send buffer size.

◆ setMaxQueuedPackets()

void fm.liveswitch.UdpSocket.setMaxQueuedPackets ( int  value)

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

Reimplemented from fm.liveswitch.DatagramSocket.