AS AgentScopeAPI 手册 / API Reference

WebSocketTransportConfig

public class WebSocketTransportConfig
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:39–237

用于WebSocket 客户端的配置。位于 io.agentscope.core.model.transport.websocket 包。核心成员包括 getConnectTimeout、getReadTimeout、getWriteTimeout、getPingInterval、getProxyConfig、isIgnoreSsl。

Configuration for WebSocket clients.

This class holds configuration options for WebSocket client behavior such as timeouts, heartbeat intervals, proxy settings, and SSL options.

Usage example:

`WebSocketTransportConfig config = WebSocketTransportConfig.builder()
.connectTimeout(Duration.ofSeconds(30))
.pingInterval(Duration.ofSeconds(30))
.proxy(ProxyConfig.http("proxy.example.com", 8080))
.build();

WebSocketTransport client = OkHttpWebSocketTransport.create(config);
`

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
Builder类class
WebSocketTransportConfig的构建器。
Builder for WebSocketTransportConfig.

字段摘要Field Summary

字段Field类型Type说明Description
DEFAULT_CONNECT_TIMEOUT
staticfinal
Duration
默认连接超时字段。
Default connect timeout: 30 seconds.
DEFAULT_READ_TIMEOUT
staticfinal
Duration
用于WebSocket)的默认读取超时:0(无超时。
Default read timeout: 0 (no timeout for WebSocket).
DEFAULT_WRITE_TIMEOUT
staticfinal
Duration
默认写入超时字段。
Default write timeout: 30 seconds.
DEFAULT_PING_INTERVAL
staticfinal
Duration
默认 PING 间隔字段。
Default ping interval: 30 seconds.

方法摘要Method Summary

方法Method说明Description
public Duration getConnectTimeout()
获取连接超时。
Get the connect timeout.
public Duration getReadTimeout()
获取读取超时。
Get the read timeout.
public Duration getWriteTimeout()
获取写入超时。
Get the write timeout.
public Duration getPingInterval()
获取 `getPingInterval`。
Get the ping interval for heartbeat (OkHttp only).
public ProxyConfig getProxyConfig()
获取代理配置。
Get the proxy configuration.
public boolean isIgnoreSsl()
判断是否 `isIgnoreSsl`。
Get whether SSL certificate verification should be ignored.
public static Builder builder()
static
创建用于WebSocketTransportConfig的构建器。
Create a new builder for WebSocketTransportConfig.
public static WebSocketTransportConfig defaults()
static
创建默认配置。
Create a default configuration.

字段详情Field Detail

DEFAULT_CONNECT_TIMEOUT

public static final Duration DEFAULT_CONNECT_TIMEOUT
staticfinal

默认连接超时字段。声明为 public static final Duration DEFAULT_CONNECT_TIMEOUT。

Default connect timeout: 30 seconds.

源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:42

DEFAULT_READ_TIMEOUT

public static final Duration DEFAULT_READ_TIMEOUT
staticfinal

用于WebSocket)的默认读取超时:0(无超时。

Default read timeout: 0 (no timeout for WebSocket).

源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:45

DEFAULT_WRITE_TIMEOUT

public static final Duration DEFAULT_WRITE_TIMEOUT
staticfinal

默认写入超时字段。声明为 public static final Duration DEFAULT_WRITE_TIMEOUT。

Default write timeout: 30 seconds.

源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:48

DEFAULT_PING_INTERVAL

public static final Duration DEFAULT_PING_INTERVAL
staticfinal

默认 PING 间隔字段。声明为 public static final Duration DEFAULT_PING_INTERVAL。

Default ping interval: 30 seconds.

源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:51

方法详情Method Detail

getConnectTimeout

public Duration getConnectTimeout()

获取连接超时。

Get the connect timeout.

返回Returns Duration
连接超时时长。the connect timeout duration
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:74–76

getReadTimeout

public Duration getReadTimeout()

获取读取超时。

Get the read timeout.

返回Returns Duration
读取超时时长。the read timeout duration
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:83–85

getWriteTimeout

public Duration getWriteTimeout()

获取写入超时。

Get the write timeout.

返回Returns Duration
写入超时时长。the write timeout duration
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:92–94

getPingInterval

public Duration getPingInterval()

获取 getPingInterval。

Get the ping interval for heartbeat (OkHttp only).

返回Returns Duration
返回时长。the ping interval duration
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:101–103

getProxyConfig

public ProxyConfig getProxyConfig()

获取代理配置。

Get the proxy configuration.

返回Returns ProxyConfig
返回ProxyConfig。the proxy configuration, or null if no proxy is configured
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:110–112

isIgnoreSsl

public boolean isIgnoreSsl()

判断是否 isIgnoreSsl。

Get whether SSL certificate verification should be ignored.

返回Returns boolean
返回布尔值,表示判断结果。true to ignore SSL certificate verification, false otherwise
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:123–125

builder

public static Builder builder()
static

创建用于WebSocketTransportConfig的构建器。

Create a new builder for WebSocketTransportConfig.

返回Returns Builder
一种新的构建器实例。a new Builder instance
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:132–134

defaults

public static WebSocketTransportConfig defaults()
static

创建默认配置。

Create a default configuration.

返回Returns WebSocketTransportConfig
一种默认 WebSocketTransportConfig 实例。a default WebSocketTransportConfig instance
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:141–143

嵌套类详情Nested Class Detail

Builder

public static class Builder

WebSocketTransportConfig的构建器。位于 io.agentscope.core.model.transport.websocket 包。核心成员包括 connectTimeout、readTimeout、writeTimeout、pingInterval、proxy、ignoreSsl。

Builder for WebSocketTransportConfig.

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.