diff --git a/client/client.go b/client/client.go index 6751b83..b9edbc8 100644 --- a/client/client.go +++ b/client/client.go @@ -3,13 +3,14 @@ package client import ( "git.loafle.net/commons_go/rpc" "git.loafle.net/commons_go/rpc/client" + crcrwf "git.loafle.net/commons_go/rpc/client/rwc/websocket/fasthttp" ) func New(addr string, registry rpc.Registry) client.Client { ch := NewClientHandler(addr, registry) - - c := client.New(ch) + cRWCHandler := crcrwf.New() + c := client.New(ch, cRWCHandler) return c } diff --git a/client/client_rwc_handlers.go b/client/client_rwc_handlers.go new file mode 100644 index 0000000..13d3fc7 --- /dev/null +++ b/client/client_rwc_handlers.go @@ -0,0 +1,36 @@ +package client + +import ( + "fmt" + "net/http" + "net/url" + + crcrwf "git.loafle.net/commons_go/rpc/client/rwc/websocket/fasthttp" + "git.loafle.net/commons_go/websocket_fasthttp/websocket" +) + +type ClientReadWriteCloseHandlers struct { + crcrwf.ClientReadWriteCloseHandlers + + Scheme string + Host string + Path string +} + +func (crwch *ClientReadWriteCloseHandlers) Connect() (interface{}, error) { + u := url.URL{ + Scheme: crwch.Scheme, + Host: crwch.Host, + Path: crwch.Path, + } + var reqHeader http.Header + reqHeader.Add("", "") + + conn, res, err := websocket.DefaultDialer.Dial(u.String(), reqHeader) + + return nil, fmt.Errorf("RPC Client RWC Handler: ClientHandlers method[Connect] is not implement") +} + +func (crwch *ClientReadWriteCloseHandlers) Validate() { + +}