2017-12-05 05:20:42 +00:00
|
|
|
package client
|
|
|
|
|
|
|
|
import (
|
|
|
|
crc "git.loafle.net/commons_go/rpc/client"
|
|
|
|
crcrs "git.loafle.net/commons_go/rpc/client/rwc/socket"
|
2017-12-15 07:47:39 +00:00
|
|
|
crr "git.loafle.net/commons_go/rpc/registry"
|
2017-12-05 05:20:42 +00:00
|
|
|
)
|
|
|
|
|
2017-12-15 07:47:39 +00:00
|
|
|
func New(addr string, rpcInvoker crr.RPCInvoker) crc.Client {
|
|
|
|
clientHandler := newClientHandler(rpcInvoker)
|
|
|
|
socketHandler := newSocketHandler()
|
|
|
|
|
2017-12-05 07:29:42 +00:00
|
|
|
socketBuilder := NewSocketBuilder(addr, socketHandler)
|
2017-12-05 05:20:42 +00:00
|
|
|
cRWCHandler := crcrs.New(socketBuilder)
|
|
|
|
|
|
|
|
c := crc.New(clientHandler, cRWCHandler)
|
|
|
|
|
|
|
|
return c
|
|
|
|
}
|