-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoptions.go
More file actions
55 lines (43 loc) · 1.53 KB
/
Copy pathoptions.go
File metadata and controls
55 lines (43 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package blazewave
import (
"time"
"github.com/heyehang/blazewave/core/pool"
"github.com/heyehang/blazewave/core/timer"
)
// CommonOptions contains common options for both client and server
type CommonOptions struct {
// Subprotocols lists the WebSocket subprotocols to negotiate with the server.
Subprotocols []string
// CompressionMode controls the compression mode.
// Defaults to CompressionDisabled.
//
// See docs on CompressionMode for details.
CompressionMode CompressionMode
// CompressionThreshold controls the minimum size of a message before compression is applied.
//
// Defaults to 512 bytes for CompressionNoContextTakeover and 128 bytes
// for CompressionContextTakeover.
CompressionThreshold int
// ReaderPool is the reader of the ring pool.
ReaderPool pool.BufferPool
// WriterPool is the writer of the ring pool.
WriterPool pool.BufferPool
// HeartbeatInterval sets the interval for heartbeat ping messages.
// If set to 0, heartbeat is disabled.
// Default is 0 (disabled).
HeartbeatInterval time.Duration
// HeartbeatTimeout sets the timeout for heartbeat pong responses.
// If no pong is received within this timeout, the connection is closed.
// Default is 10 seconds.
HeartbeatTimeout time.Duration
// HeartbeatTimer is the timer pool for heartbeat management.
// If not provided, a new timer will be created for each connection.
HeartbeatTimer timer.TimerPool
}
// ServerOptions contains options for creating a server
type ServerOption struct {
CommonOptions
}
type DialOption struct {
CommonOptions
}