xlang v4.0 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | 包函数 | 静态包属性
StreamSocket类 参考

tcp协议套接字 更多...

类 StreamSocket 继承关系图:
Stream

Public 成员函数

静态 Public 成员函数

包函数

静态包属性

额外继承的成员函数

详细描述

tcp协议套接字

在文件 BuiltinObjects.x954 行定义.

构造及析构函数说明

◆ StreamSocket() [1/2]

◆ StreamSocket() [2/2]

void StreamSocket ( )
package

构造函数

成员函数说明

◆ accept() [1/2]

◆ accept() [2/2]

StreamSoket accept ( )
package

接受连接

返回
新连接

◆ available() [1/3]

long available ( bool  wait)
package

是否可读

参数
wait是否等待
返回
可读长度

实现了 Stream.

◆ available() [2/3]

long available ( bool  ) throws IllegalArgumentException, IOException, InterruptedException

实现了 Stream.

◆ available() [3/3]

int available ( long  ,
int   
)

◆ bind()

bool bind ( String  host,
int  port 
)
package

bind地址

参数
host地址
port端口
返回
结果

◆ close() [1/2]

void close ( ) throws IllegalArgumentException

实现了 Stream.

◆ close() [2/2]

void close ( )
package

关闭套接字

实现了 Stream.

◆ connect() [1/2]

bool connect ( String  host,
int  port 
)
package

建立UDP连接

参数
host地址
port端口
返回
结果

◆ connect() [2/2]

bool connect ( String  ,
int  ,
int   
) throws TimeoutException, InterruptedException

◆ enableKeepAlive()

bool enableKeepAlive ( bool  be)
package

开启禁用长连接

参数
be开启或禁用
返回
结果

◆ enableNagle()

bool enableNagle ( bool  be)
package

开启禁用nagle算法

参数
be开启或禁用
返回
结果

◆ finalize()

void finalize ( )

◆ flush()

void flush ( ) throws IOException

实现了 Stream.

◆ getHandle() [1/2]

long getHandle ( )

◆ getHandle() [2/2]

int getHandle ( )
package

获取套接字句柄

返回
句柄

◆ getKeepAlive()

bool getKeepAlive ( )

◆ getLocalAddress()

int getLocalAddress ( )
package

获取本地32位的IP地址信息

返回
结果

◆ getLocalInetAddress() [1/2]

InetAddress getLocalInetAddress ( )

◆ getLocalInetAddress() [2/2]

InetAddress getLocalInetAddress ( )
package

获取本地地址信息

返回
结果

◆ getLocalIpAddress()

String getLocalIpAddress ( )

◆ getLocalPort() [1/2]

int getLocalPort ( )

◆ getLocalPort() [2/2]

int getLocalPort ( )
package

获取本地端口信息

返回
结果

◆ getPosition()

long getPosition ( ) throws IllegalArgumentException, IOException

实现了 Stream.

◆ getRemoteAddress()

int getRemoteAddress ( )
package

获取远程32位的IP地址信息

返回
结果

◆ getRemoteInetAddress() [1/2]

InetAddress getRemoteInetAddress ( )

◆ getRemoteInetAddress() [2/2]

InetAddress getRemoteInetAddress ( )
package

获取远程地址信息

返回
结果

◆ getRemoteIpAddress()

String getRemoteIpAddress ( )

◆ getRemotePort() [1/2]

int getRemotePort ( )

◆ getRemotePort() [2/2]

int getRemotePort ( )
package

获取远程端口信息

返回
结果

◆ getReuseAddress()

bool getReuseAddress ( )

◆ getSelectFlags()

int getSelectFlags ( )
package

获取select触发的选项

返回
结果

◆ getTcpNoDelay()

bool getTcpNoDelay ( )

◆ isConnected() [1/2]

bool isConnected ( )

◆ isConnected() [2/2]

bool isConnected ( )
package

是否已连接

返回
true false

◆ isKeepAliveEnabled()

bool isKeepAliveEnabled ( )
package

检查是否开启长连接

返回
结果

◆ isNagleEnabled()

bool isNagleEnabled ( )
package

检查是否开启nagle算法

返回
结果

◆ length()

long length ( ) throws IllegalArgumentException, IOException

实现了 Stream.

◆ listen() [1/2]

bool listen ( int  port,
int  backlog 
)
package

监听端口

参数
port端口号
backlog连接等待数量
返回
结果

◆ listen() [2/2]

bool listen ( String  ,
int  ,
int   
)

◆ read() [1/2]

int read ( byte []  buffer,
int  pos,
int  length 
)
package

读取数据

参数
buffer缓冲区
pos位置
length长度
返回
读取长度

实现了 Stream.

◆ read() [2/2]

实现了 Stream.

◆ readBool()

实现了 Stream.

◆ readBoolLE()

实现了 Stream.

◆ readChar()

实现了 Stream.

◆ readCharLE()

实现了 Stream.

◆ readDouble()

实现了 Stream.

◆ readDoubleLE()

实现了 Stream.

◆ readFloat()

实现了 Stream.

◆ readFloatLE()

实现了 Stream.

◆ readInt()

实现了 Stream.

◆ readIntLE()

实现了 Stream.

◆ readLong()

实现了 Stream.

◆ readLongLE()

实现了 Stream.

◆ readShort()

实现了 Stream.

◆ readShortLE()

实现了 Stream.

◆ readString()

实现了 Stream.

◆ readStringLE()

实现了 Stream.

◆ seek()

long seek ( int  ,
long   
) throws IndexOutOfBoundsException, IllegalArgumentException, IOException

实现了 Stream.

◆ select() [1/2]

int select ( StreamSocket []  sockets,
int  offset,
int  count,
int []  sets,
int  timeout 
)
package

选择事件触发的socket

参数
offset偏移量
count选择的总数量
sets数组 用于接收结果
time超时
返回
结果

◆ select() [2/2]

static final int select ( StreamSocket  [],
int  ,
int  ,
int  ,
int  [],
int   
) throws IndexOutOfBoundsException, IllegalArgumentException, InterruptedException
static

◆ setKeepAlive()

bool setKeepAlive ( bool  )

◆ setReuseAddress()

bool setReuseAddress ( bool  )

◆ setSelectFlags()

void setSelectFlags ( int  flags)
package

设置select触发的选项

返回
结果

◆ setSoTimeout()

bool setSoTimeout ( int  )

◆ setTcpNoDelay()

bool setTcpNoDelay ( bool  )

◆ setTimeout()

bool setTimeout ( int  millis)
package

设置超时

参数
millis超时毫秒数
返回
true false

◆ write() [1/2]

int write ( byte []  buffer,
int  pos,
int  length 
)
package

写入数据

参数
buffer缓冲区
pos位置
length长度
返回
写入的长度

实现了 Stream.

◆ write() [2/2]

实现了 Stream.

◆ writeBool()

实现了 Stream.

◆ writeBoolLE()

final void writeBoolLE ( bool  ) throws IllegalArgumentException, IOException, TimeoutException, InterruptedException

实现了 Stream.

◆ writeChar()

实现了 Stream.

◆ writeCharLE()

final void writeCharLE ( char  ) throws IllegalArgumentException, IOException, TimeoutException, InterruptedException

实现了 Stream.

◆ writeDouble()

final void writeDouble ( double  ) throws IllegalArgumentException, IOException, TimeoutException, InterruptedException

实现了 Stream.

◆ writeDoubleLE()

final void writeDoubleLE ( double  ) throws IllegalArgumentException, IOException, TimeoutException, InterruptedException

实现了 Stream.

◆ writeFloat()

final void writeFloat ( float  ) throws IllegalArgumentException, IOException, TimeoutException, InterruptedException

实现了 Stream.

◆ writeFloatLE()

final void writeFloatLE ( float  ) throws IllegalArgumentException, IOException, TimeoutException, InterruptedException

实现了 Stream.

◆ writeInt()

实现了 Stream.

◆ writeIntLE()

实现了 Stream.

◆ writeLong()

实现了 Stream.

◆ writeLongLE()

final void writeLongLE ( long  ) throws IllegalArgumentException, IOException, TimeoutException, InterruptedException

实现了 Stream.

◆ writeShort()

final void writeShort ( short  ) throws IllegalArgumentException, IOException, TimeoutException, InterruptedException

实现了 Stream.

◆ writeShortLE()

final void writeShortLE ( short  ) throws IllegalArgumentException, IOException, TimeoutException, InterruptedException

实现了 Stream.

◆ writeString()

实现了 Stream.

◆ writeStringLE()

实现了 Stream.

结构体成员变量说明

◆ FLAGS_EXCEPTION

const int FLAGS_EXCEPTION
staticpackage

在文件 BuiltinObjects.x957 行定义.

◆ FLAGS_READABLE

const int FLAGS_READABLE
staticpackage

在文件 BuiltinObjects.x955 行定义.

◆ FLAGS_WRITEABLE

const int FLAGS_WRITEABLE
staticpackage

在文件 BuiltinObjects.x956 行定义.