Skip to content

Commit 93e680a

Browse files
committed
test grpc connection
1 parent 279ee2d commit 93e680a

27 files changed

+43
-1814
lines changed

api/connection.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package api
2+
3+
import (
4+
"fmt"
5+
"time"
6+
7+
"github.com/NpoolPlatform/message/npool/sphinxproxy"
8+
"github.com/google/uuid"
9+
)
10+
11+
func (s *Server) ProxyConnnection(stream sphinxproxy.SphinxProxy_ProxyConnnectionServer) error {
12+
return nil
13+
}
14+
15+
func TestConnectionRecv(stream sphinxproxy.SphinxProxy_ProxyConnnectionServer) {
16+
for i := 0; i < 100; i++ {
17+
data, err := stream.Recv()
18+
fmt.Println("recv:", data, err)
19+
}
20+
}
21+
22+
func TestConnectionSend(stream sphinxproxy.SphinxProxy_ProxyConnnectionServer) {
23+
for i := 0; i < 100; i++ {
24+
time.Sleep(time.Second)
25+
stream.Send(&sphinxproxy.DataElement{
26+
ConnectID: uuid.NewString(),
27+
Payload: []byte(fmt.Sprintf("send it from proxy, %v", i)),
28+
})
29+
}
30+
}

api/constant.go

Lines changed: 0 additions & 14 deletions
This file was deleted.

api/create_transaction.go

Lines changed: 0 additions & 103 deletions
This file was deleted.

api/create_wallet.go

Lines changed: 0 additions & 126 deletions
This file was deleted.

0 commit comments

Comments
 (0)