We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
client-code
func testBidiStream(cli greet.GreetService) error { stream, err := cli.GreetStream(context.Background()) if err != nil { return err } for i := 0; i < 10; i++ { if sendErr := stream.Send(&greet.GreetStreamRequest{Name: "triple"}); sendErr != nil { return err } _, err := stream.Recv() if err != nil { return err } } if err := stream.CloseRequest(); err != nil { return err } if err := stream.CloseResponse(); err != nil { return err } fmt.Printf("%v\n", stream.ResponseTrailer()) return nil }
server-code
func (srv *GreetTripleServer) GreetStream(ctx context.Context, stream greet.GreetService_GreetStreamServer) error { str, _ := json.MarshalIndent(ctx.Value(constant.AttachmentKey), "", "\t") fmt.Printf("%v\n", string(str)) for { req, err := stream.Recv() if err != nil { if triple.IsEnded(err) { break } return fmt.Errorf("triple BidiStream recv error: %s", err) } if err := stream.Send(&greet.GreetStreamResponse{Greeting: req.Name}); err != nil { return fmt.Errorf("triple BidiStream send error: %s", err) } } stream.ResponseTrailer().Set("responeTrailerKey", strconv.Itoa(rand.Int())) stream.ResponseTrailer().Add("responeTrailerKey", strconv.Itoa(rand.Int())) return nil }
是我的使用方式有问题吗
2024-04-10 19:12:50 INFO logger/logging.go:42 URL specified explicitly tri://127.0.0.1:20000 2024-04-10 19:12:50 INFO logger/logging.go:42 [TRIPLE Protocol] Refer service: tri://127.0.0.1:20000/greet.GreetService?app.version=&application=dubbo.io&async=false&bean.name=greet.GreetService&cluster=failover&config.tracing=&environment=&generic=&group=&interface=greet.GreetService&loadbalance=&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&peer=true&provided-by=&reference.filter=cshutdown®istry.role=0&release=dubbo-golang-3.2.0&remote.timestamp=&retries=&serialization=protobuf&side=consumer&sticky=false×tamp=1712747570&version= map[]
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Environment
Issue description
client-code
server-code
是我的使用方式有问题吗
Logs
Click me to check logs
The text was updated successfully, but these errors were encountered: