APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.net

public Class SocketHints

extends Object
Class Inheritance

Options for Socket instances.
Authors
mzechner, noblemaster

Field Summary

Modifier and TypeField and Description
public int
connectTimeout

The connection timeout in milliseconds.

public boolean
keepAlive

True to enable SO_KEEPALIVE.

public boolean
linger

Enable/disable SO_LINGER with the specified linger time in seconds.

public int
lingerDuration

The linger duration in seconds (NOT milliseconds!).

public int
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.

public int
public int
receiveBufferSize

The SO_RCVBUF (receive buffer) size in bytes.

public int
sendBufferSize

The SO_SNDBUF (send buffer) size in bytes.

public int
socketTimeout

Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.

public boolean
tcpNoDelay

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

public int
trafficClass

The traffic class describes the type of connection that shall be established.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

connectTimeoutback to summary
public int connectTimeout

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

keepAliveback to summary
public boolean keepAlive

True to enable SO_KEEPALIVE.

lingerback to summary
public boolean linger

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

lingerDurationback to summary
public int lingerDuration

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

performancePrefBandwidthback to summary
public int performancePrefBandwidth
performancePrefConnectionTimeback to summary
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).

performancePrefLatencyback to summary
public int performancePrefLatency
receiveBufferSizeback to summary
public int receiveBufferSize

The SO_RCVBUF (receive buffer) size in bytes.

sendBufferSizeback to summary
public int sendBufferSize

The SO_SNDBUF (send buffer) size in bytes.

socketTimeoutback to summary
public int socketTimeout

Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. With this option set to a non-zero timeout, a read() call on the InputStream associated with this Socket will block for only this amount of time

tcpNoDelayback to summary
public boolean tcpNoDelay

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

trafficClassback to summary
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 :

  • IPTOS_LOWCOST (0x02) - cheap!
  • IPTOS_RELIABILITY (0x04) - reliable connection with little package loss.
  • IPTOS_THROUGHPUT (0x08) - lots of data being sent.
  • IPTOS_LOWDELAY (0x10) - low delay.

Constructor Detail

SocketHintsback to summary
public SocketHints()