overflow_gateway_websocket/client/client_handlers.go
crusader 6ac6a2c21b ing
2017-11-29 19:07:49 +09:00

29 lines
508 B
Go

package client
import (
"net"
"git.loafle.net/commons_go/rpc"
"git.loafle.net/commons_go/rpc/client"
"git.loafle.net/commons_go/rpc/protocol/json"
)
func NewClientHandler(addr string, registry rpc.Registry) ClientHandler {
ch := &ClientHandlers{}
ch.addr = addr
ch.RPCRegistry = registry
ch.Codec = json.NewClientCodec()
return ch
}
type ClientHandlers struct {
client.ClientHandlers
addr string
}
func (ch *ClientHandlers) Connect() (net.Conn, error) {
return net.Dial("unix", ch.addr)
}