mirror of
https://github.com/gortc/stun.git
synced 2025-10-06 00:56:56 +08:00
client: update defaults and comments
This commit is contained in:
10
client.go
10
client.go
@@ -37,10 +37,10 @@ type ClientOptions struct {
|
|||||||
// agent implementation in current package, see agent.go.
|
// agent implementation in current package, see agent.go.
|
||||||
Agent ClientAgent
|
Agent ClientAgent
|
||||||
// RTO as defined in STUN RFC.
|
// RTO as defined in STUN RFC.
|
||||||
RTO time.Duration // defaults to 500ms
|
RTO time.Duration // defaults to 100ms
|
||||||
// TimeoutRate is rate passed to Collector, the minimum duration between
|
// TimeoutRate is rate passed to Collector, the minimum duration between
|
||||||
// two calls of collector function.
|
// two calls of collector function (efficient minimum RTO timer resolution).
|
||||||
TimeoutRate time.Duration // defaults to 100ms
|
TimeoutRate time.Duration // defaults to 5ms
|
||||||
// Collector is optional implementation of ticker which calls function on each tick.
|
// Collector is optional implementation of ticker which calls function on each tick.
|
||||||
Collector Collector // defaults to ticker collector
|
Collector Collector // defaults to ticker collector
|
||||||
// Clock is optional source of current time.
|
// Clock is optional source of current time.
|
||||||
@@ -57,8 +57,8 @@ var ErrNoConnection = errors.New("no connection provided")
|
|||||||
// resources.
|
// resources.
|
||||||
func NewClient(options ClientOptions) (*Client, error) {
|
func NewClient(options ClientOptions) (*Client, error) {
|
||||||
const (
|
const (
|
||||||
defaultTimeoutRate = time.Millisecond * 100
|
defaultTimeoutRate = time.Millisecond * 5
|
||||||
defaultRTO = defaultTimeoutRate * 5
|
defaultRTO = time.Millisecond * 300
|
||||||
)
|
)
|
||||||
c := &Client{
|
c := &Client{
|
||||||
close: make(chan struct{}),
|
close: make(chan struct{}),
|
||||||
|
Reference in New Issue
Block a user