加载中...
The Wayback Machine - https://sup1a9wrlpyh5li9ro.vcoronado.top/web/20090302013048/http://developer.android.com:80/reference/java/net/SocketOptions.html
public interface

SocketOptions

java.net.SocketOptions
Known Indirect Subclasses

Class Overview

Defines the protocol to get & set Socket options.

Summary

Constants
int IP_MULTICAST_IF
int IP_MULTICAST_IF2
int IP_MULTICAST_LOOP
int IP_TOS
int SO_BINDADDR
int SO_BROADCAST
int SO_KEEPALIVE
int SO_LINGER
int SO_OOBINLINE
int SO_RCVBUF
int SO_REUSEADDR
int SO_SNDBUF
int SO_TIMEOUT Timeout for blocking operation.
int TCP_NODELAY
Public Methods
abstract Object getOption(int optID)
Answer the declared socket option.
abstract void setOption(int optID, Object val)
Set the declared socket option to the value.

Constants

public static final int IP_MULTICAST_IF

Constant Value: 16 (0x00000010)

public static final int IP_MULTICAST_IF2

Constant Value: 31 (0x0000001f)

public static final int IP_MULTICAST_LOOP

Constant Value: 18 (0x00000012)

public static final int IP_TOS

Constant Value: 3 (0x00000003)

public static final int SO_BINDADDR

Constant Value: 15 (0x0000000f)

public static final int SO_BROADCAST

Constant Value: 32 (0x00000020)

public static final int SO_KEEPALIVE

Constant Value: 8 (0x00000008)

public static final int SO_LINGER

Constant Value: 128 (0x00000080)

public static final int SO_OOBINLINE

Constant Value: 4099 (0x00001003)

public static final int SO_RCVBUF

Constant Value: 4098 (0x00001002)

public static final int SO_REUSEADDR

Constant Value: 4 (0x00000004)

public static final int SO_SNDBUF

Constant Value: 4097 (0x00001001)

public static final int SO_TIMEOUT

Timeout for blocking operation. The argument value is specified in milliseconds.

Constant Value: 4102 (0x00001006)

public static final int TCP_NODELAY

Constant Value: 1 (0x00000001)

Public Methods

public abstract Object getOption (int optID)

Answer the declared socket option.

Parameters
optID the option identifier
Returns
  • Object the option value
Throws
SocketException thrown if an error occurs getting the option

public abstract void setOption (int optID, Object val)

Set the declared socket option to the value.

Parameters
optID the option identifier
val the option value to be set
Throws
SocketException thrown if an error occurs setting the option