Builder
public static class Builder
源码Source
io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:148–236WebSocketTransportConfig的构建器。位于 io.agentscope.core.model.transport.websocket 包。核心成员包括 connectTimeout、readTimeout、writeTimeout、pingInterval、proxy、ignoreSsl。
Builder for WebSocketTransportConfig.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Builder connectTimeout(Duration connectTimeout) | 设置连接超时。 Set the connect timeout. |
public Builder readTimeout(Duration readTimeout) | 设置读取超时。 Set the read timeout. |
public Builder writeTimeout(Duration writeTimeout) | 设置写入超时。 Set the write timeout. |
public Builder pingInterval(Duration pingInterval) | 设置该配置项。 Set the ping interval for heartbeat (OkHttp only). |
public Builder proxy(ProxyConfig proxyConfig) | 设置代理配置。 Set the proxy configuration. |
public Builder ignoreSsl(boolean ignoreSsl) | 设置该配置项。 Set whether to ignore SSL certificate verification. |
public WebSocketTransportConfig build() | 构建WebSocketTransportConfig。 Build the WebSocketTransportConfig. |
方法详情Method Detail
connectTimeout
public Builder connectTimeout(Duration connectTimeout)
设置连接超时。
Set the connect timeout.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
connectTimeout | Duration | 连接超时时长。the connect timeout duration |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:162–165readTimeout
public Builder readTimeout(Duration readTimeout)
设置读取超时。
Set the read timeout.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
readTimeout | Duration | 读取超时时长。the read timeout duration |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:173–176writeTimeout
public Builder writeTimeout(Duration writeTimeout)
设置写入超时。
Set the write timeout.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
writeTimeout | Duration | 写入超时时长。the write timeout duration |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:184–187pingInterval
public Builder pingInterval(Duration pingInterval)
设置该配置项。
Set the ping interval for heartbeat (OkHttp only).
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
pingInterval | Duration | ping 间隔(类型 `Duration`)。the ping interval duration |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:195–198proxy
public Builder proxy(ProxyConfig proxyConfig)
设置代理配置。
Set the proxy configuration.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
proxyConfig | ProxyConfig | 代理配置。the proxy configuration |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:208–211ignoreSsl
public Builder ignoreSsl(boolean ignoreSsl)
设置该配置项。
Set whether to ignore SSL certificate verification.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ignoreSsl | boolean | ignore Ssl(类型 `boolean`)。true to ignore SSL certificate verification, false otherwise |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:223–226build
public WebSocketTransportConfig build()
构建WebSocketTransportConfig。
Build the WebSocketTransportConfig.
WebSocketTransportConfig一种新的WebSocketTransportConfig 实例。a new WebSocketTransportConfig instance
源码Source
io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:233–235