asyncudp
Class ASyncUDPParams

java.lang.Object
  extended by asyncudp.ASyncUDPParams

public class ASyncUDPParams
extends java.lang.Object

A class containing all parameters used by an ASyncUDP instance.

Author:
Michael Parker

Field Summary
static int DEFAULT_MAX_SEGMENT_SIZE
           
static int DEFAULT_RECV_BUFFER_SIZE
           
 
Method Summary
 boolean copyParams(ASyncUDPParams audpp)
          Sets all parameter values to those contained in audpp.
 ASyncUDP getASyncUDP()
          Returns the ASyncUDP instance that these parameters configure.
 int getMaximumSegmentSize()
          Returns the maximum size, in bytes, of any UDP datagram that can be sent.
 int getRecvBufferSize()
          Returns the size, in bytes, of the application-level receive buffer for the ASyncUDP instance.
 boolean setMaximumSegmentSize(int _size)
          Sets the maximum size, in bytes, of any UDP datagram that can be sent.
 boolean setRecvBufferSize(int _size)
          Sets the size, in bytes, of the application-level receive buffer for the ASyncUDP instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_SEGMENT_SIZE

public static final int DEFAULT_MAX_SEGMENT_SIZE
See Also:
Constant Field Values

DEFAULT_RECV_BUFFER_SIZE

public static final int DEFAULT_RECV_BUFFER_SIZE
See Also:
Constant Field Values
Method Detail

getASyncUDP

public ASyncUDP getASyncUDP()
Returns the ASyncUDP instance that these parameters configure.

Returns:
the corresponding ASyncUDP instance

copyParams

public boolean copyParams(ASyncUDPParams audpp)
Sets all parameter values to those contained in audpp. Note that this method may fail if the associated ASyncUDP instance is already in use.

Parameters:
audpp - the ASyncUDPParams object whose parmaeters should be used
Returns:
true if the parameters are copied successfully, false otherwise

getMaximumSegmentSize

public int getMaximumSegmentSize()
Returns the maximum size, in bytes, of any UDP datagram that can be sent. This is typically referred to as the Maximum Segment Size, or MSS. No message in its serialized form can exceed this size, as each message must be sent in an individual UDP datagram.

Returns:
the maximum segment size, in bytes

setMaximumSegmentSize

public boolean setMaximumSegmentSize(int _size)
Sets the maximum size, in bytes, of any UDP datagram that can be sent. This is typically referred to as the Maximum Segment Size, or MSS. No message in its serialized form can exceed this size, as each message must be sent in an individual UDP datagram.

Parameters:
_size - the maximum segment size, in bytes
Returns:
true if the new send buffer size is set successfully, false otherwise

getRecvBufferSize

public int getRecvBufferSize()
Returns the size, in bytes, of the application-level receive buffer for the ASyncUDP instance.

Returns:
the receive buffer size, in bytes

setRecvBufferSize

public boolean setRecvBufferSize(int _size)
Sets the size, in bytes, of the application-level receive buffer for the ASyncUDP instance. Note that this method may fail if the associated ASyncUDP instance is already in use.

Parameters:
_size - the receive buffer size, in bytes
Returns:
true if the new receive buffer size is set successfully, false otherwise