MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / client

Function client

crypto/etls/conn_test.go:107–133  ·  view source on GitHub ↗
(pass string)

Source from the content-addressed store, hash-verified

105}
106
107func client(pass string) (ret int, err error) {
108
109 cipher := NewCipher([]byte(pass))
110
111 conn, err := Dial("tcp", service, cipher)
112 //conn, err := net.dial("tcp", service)
113 if err != nil {
114 log.Errorf("client: dial: %s", err)
115 return 0, err
116 }
117 defer func() { _ = conn.Close() }()
118 //conn.SetDeadline(time.Time{})
119 //conn.SetReadDeadline(time.Time{})
120 //conn.SetWriteDeadline(time.Time{})
121
122 log.Debugln("client: connected to: ", conn.RemoteAddr())
123 log.Debugln("client: LocalAddr: ", conn.LocalAddr())
124 rpcClient := rpc.NewClient(conn)
125 res := new(Result)
126 args := strings.Repeat("a", contentLength)
127 if err := rpcClient.Call("Foo.Bar", args, &res); err != nil {
128 log.Errorf("failed to call RPC %v", err)
129 return 0, err
130 }
131 log.Debugf("Returned result is %d", res.Data)
132 return res.Data, err
133}
134
135func serverComplex() *CryptoListener {
136 if err := rpc.Register(new(FooComplex)); err != nil {

Callers 1

TestSimpleRPCFunction · 0.85

Calls 9

CallMethod · 0.95
ErrorfFunction · 0.92
DebuglnFunction · 0.92
DebugfFunction · 0.92
NewCipherFunction · 0.85
RemoteAddrMethod · 0.80
LocalAddrMethod · 0.80
DialFunction · 0.70
CloseMethod · 0.65

Tested by

no test coverage detected