func NewGrpcHandler(ctx context.Context, host host.Host) *GrpcHandler {
	grpcServer := grpc.NewServer()
	ghandler := &GrpcHandler{
		ctx:        ctx,
		host:       host,
		grpcServer: grpcServer,
		streamCh:   make(chan network.Stream),
	}
	host.SetStreamHandler(Protocol, ghandler.HandleStream)
	// Serve will not return until Accept fails, when the ctx is canceled.
	go grpcServer.Serve(newGrpcListener(ghandler))
	return ghandler
}
// NewGrpcHandler attaches the GRPC protocol to a host.
NewGrpcHandler attaches the GRPC protocol to a host.
// NewGrpcHandler attaches the GRPC protocol to a host .
func NewGrpcHandler(ctx context.Context, host host.Host) *GrpcHandler {
	grpcServer := grpc.NewServer()
	ghandler := &GrpcHandler{
		ctx:        ctx,
		host:       host,
		grpcServer: grpcServer,
		streamCh:   make(chan network.Stream),
	}
	host.SetStreamHandler(Protocol, ghandler.HandleStream)
	go grpcServer.Serve(newGrpcListener(ghandler))
	return ghandler
}
func NewGrpcHandler ( ctx context . Context , host host . Host ) * GrpcHandler { grpcServer := grpc . NewServer ( ) ghandler := & GrpcHandler { ctx : ctx , host : host , grpcServer : grpcServer , streamCh : make ( chan network . Stream ) , } host . SetStreamHandler ( Protocol , ghandler . HandleStream ) go grpcServer . Serve ( newGrpcListener ( ghandler ) ) return ghandler }
NewGrpcHandler attaches the GRPC protocol to a host.
NewGrpcHandler attaches the GRPC protocol to a host .
// Serve will not return until Accept fails, when the ctx is canceled.