Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.
This repository was archived by the owner on Sep 4, 2024. It is now read-only.

all SubConns are in TransientFailure #1

@inaxium

Description

@inaxium

grpcurl -d '{"content": "frank"}' -proto echo-grpc/api/echo.proto -insecure -v 35.204.67.35:443 api.Echo/Echo

Work

package main

import (
	"golang.org/x/net/context"
	"google.golang.org/grpc"
	"google.golang.org/grpc/keepalive"
	"log"
	"test_grpc_connect/api"
	"time"
)

func main() {


	var conn *grpc.ClientConn
	conn, err := grpc.Dial("35.204.67.35:443", grpc.WithInsecure(),
		grpc.WithKeepaliveParams(keepalive.ClientParameters{
			Time:                30 * time.Second,
			Timeout:             20 * time.Second,
			PermitWithoutStream: true,
		}))
	if err != nil {
		log.Fatalf("did not connect: %s", err)
	}

	defer conn.Close()

	c := api.NewEchoClient(conn)

	ctx, cancel := context.WithTimeout(context.Background(), time.Duration(5*time.Second))
	defer cancel()
	r, err := c.Echo(ctx, &api.EchoRequest{Content:"Frank"})
	if err != nil {
		log.Fatalf("could not echo: %v", err)
	}
	log.Printf("Echo: %s", r.Content)
}

Doesn't work.

I try a lot.

I could not find the right solution yet. Maybe you are faster.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions