server/client/socket_builder.go
crusader 41382db599 ing
2017-12-05 16:21:32 +09:00

34 lines
624 B
Go

package client
import (
"crypto/tls"
"net"
"time"
cuc "git.loafle.net/commons_go/util/context"
)
type SocketBuilder interface {
SocketContext(parent cuc.Context) SocketContext
Dial(network, address string) (net.Conn, error)
GetSocketHandler() SocketHandler
GetNetwork() string
GetAddress() string
GetTLSConfig() *tls.Config
GetHandshakeTimeout() time.Duration
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()
}