com.badlogic.gdx.net
Class SocketHints

java.lang.Object
  extended by com.badlogic.gdx.net.SocketHints

public class SocketHints
extends Object

Options for Socket instances.

Author:
mzechner, noblemaster

Field Summary
 int connectTimeout
          The connection timeout in milliseconds.
 boolean keepAlive
          True to enable SO_KEEPALIVE.
 boolean linger
          Enable/disable SO_LINGER with the specified linger time in seconds.
 int lingerDuration
          The linger duration in seconds (NOT milliseconds!).
 int performancePrefBandwidth
           
 int performancePrefConnectionTime
          Performance preferences are described by three integers whose values indicate the relative importance of short connection time, low latency, and high bandwidth.
 int performancePrefLatency
           
 int receiveBufferSize
          The SO_RCVBUF (receive buffer) size in bytes.
 int sendBufferSize
          The SO_SNDBUF (send buffer) size in bytes.
 boolean tcpNoDelay
          True to enable TCP_NODELAY (disable/enable Nagle's algorithm).
 int trafficClass
          The traffic class describes the type of connection that shall be established.
 
Constructor Summary
SocketHints()
           
 
Method Summary
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connectTimeout

public int connectTimeout
The connection timeout in milliseconds. Not used for sockets created via server.accept().


performancePrefConnectionTime

public int performancePrefConnectionTime
Performance preferences are described by three integers whose values indicate the relative importance of short connection time, low latency, and high bandwidth. The absolute values of the integers are irrelevant; in order to choose a protocol the values are simply compared, with larger values indicating stronger preferences. Negative values represent a lower priority than positive values. If the application prefers short connection time over both low latency and high bandwidth, for example, then it could invoke this method with the values (1, 0, 0). If the application prefers high bandwidth above low latency, and low latency above short connection time, then it could invoke this method with the values (0, 1, 2).


performancePrefLatency

public int performancePrefLatency

performancePrefBandwidth

public int performancePrefBandwidth

trafficClass

public int trafficClass
The traffic class describes the type of connection that shall be established. The traffic class must be in the range 0 <= trafficClass <= 255.

The traffic class is bitset created by bitwise-or'ing values such the following :


keepAlive

public boolean keepAlive
True to enable SO_KEEPALIVE.


tcpNoDelay

public boolean tcpNoDelay
True to enable TCP_NODELAY (disable/enable Nagle's algorithm).


sendBufferSize

public int sendBufferSize
The SO_SNDBUF (send buffer) size in bytes.


receiveBufferSize

public int receiveBufferSize
The SO_RCVBUF (receive buffer) size in bytes.


linger

public boolean linger
Enable/disable SO_LINGER with the specified linger time in seconds. Only affects socket close.


lingerDuration

public int lingerDuration
The linger duration in seconds (NOT milliseconds!). Only used if linger is true!

Constructor Detail

SocketHints

public SocketHints()


Copyright © 2013. All Rights Reserved.