InetAddress getLocalInetAddress()
获取本地地址信息
bool isNagleEnabled()
检查是否开启nagle算法
int getLocalAddress()
获取本地32位的IP地址信息
int getRemoteAddress()
获取远程32位的IP地址信息
int write(byte [] buffer, int pos, int length)
写入数据
int getLocalPort()
获取本地端口信息
bool enableNagle(bool be)
开启禁用nagle算法
long available(bool wait)
是否可读
void setSelectFlags(int flags)
设置select触发的选项
int getSelectFlags()
获取select触发的选项
bool setTimeout(int millis)
设置超时
InetAddress getRemoteInetAddress()
获取远程地址信息
bool bind(String host, int port)
bind地址
bool isKeepAliveEnabled()
检查是否开启长连接
int select(StreamSocket [] sockets, int offset, int count, int[] sets, int timeout)
选择事件触发的socket
bool enableKeepAlive(bool be)
开启禁用长连接
bool connect(String host, int port)
建立UDP连接
int read(byte [] buffer, int pos, int length)
读取数据
int getRemotePort()
获取远程端口信息
bool listen(int port, int backlog)
监听端口