server/tcp/client_handlers.go
crusader 4163705d49 ing
2017-10-27 16:07:14 +09:00

23 lines
369 B
Go

package tcp
import (
"io"
"net"
"time"
"git.loafle.net/commons_go/server"
)
type ClientHandlers struct {
server.ClientHandlers
}
func (ch *ClientHandlers) Dial() (conn io.ReadWriteCloser, err error) {
dialer := &net.Dialer{
Timeout: ch.RequestTimeout * time.Second,
KeepAlive: ch.KeepAlivePeriod * time.Second,
}
return dialer.Dial("tcp", ch.Addr)
}