server/client/socket_builder.go

34 lines
624 B
Go
Raw Permalink Normal View History

2017-11-30 09:13:58 +00:00
package client
import (
"crypto/tls"
"net"
"time"
cuc "git.loafle.net/commons_go/util/context"
)
type SocketBuilder interface {
SocketContext(parent cuc.Context) SocketContext
2017-12-01 03:42:03 +00:00
Dial(network, address string) (net.Conn, error)
2017-11-30 09:57:09 +00:00
2017-12-05 07:21:32 +00:00
GetSocketHandler() SocketHandler
2017-11-30 09:13:58 +00:00
GetNetwork() string
GetAddress() string
GetTLSConfig() *tls.Config
2017-12-01 03:42:03 +00:00
GetHandshakeTimeout() time.Duration
2017-11-30 09:13:58 +00:00
GetKeepAlive() time.Duration
GetLocalAddress() net.Addr
// Validate is check handler value
// If you override ths method, must call
//
// func (sh *SocketHandlers) Validate() {
// sh.SocketHandlers.Validate()
// ...
// }
Validate()
}