You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a basic gRPC over Named Pipes application from the code of the documentation, the code breaks with the following error code on the channel.ConnectAsync();.
Even though there is a note about regarding the things mentioned it doesn't explain anything about how to disable.
System.InvalidOperationException: 'Channel is configured with an HTTP transport doesn't support client-side load balancing or connectivity state tracking. The underlying HTTP transport must be a SocketsHttpHandler with no SocketsHttpHandler.ConnectCallback configured. The HTTP transport must be configured on the channel using GrpcChannelOptions.HttpHandler.'
Code
Server
Program.cs
usingGrpcService1.Services;usingMicrosoft.AspNetCore.Server.Kestrel.Core;varbuilder=WebApplication.CreateBuilder(args);// Add services to the container.builder.Services.AddGrpc();builder.WebHost.ConfigureKestrel(serverOptions =>{serverOptions.ListenNamedPipe("MyPipeName", listenOptions =>{listenOptions.Protocols=HttpProtocols.Http2;});});varapp=builder.Build();// Configure the HTTP request pipeline.app.MapGrpcService<GreeterService>();app.Run();
// See https://aka.ms/new-console-template for more informationusingGrpcService1;varchannel=NamedPipesConnectionFactory.CreateChannel();awaitchannel.ConnectAsync();vargreeter=newGreeter.GreeterClient(channel);do{awaitgreeter.SayHelloAsync(newHelloRequest{Name="World"});}while(true);
That section already states:
"Some connectivity features of GrpcChannel, such as client side load balancing and channel status, can't be used together with named pipes."
Maybe something like this that is more explicit?
"Some connectivity features of GrpcChannel, such as client-side load balancing and channel status, can't be used together with named pipes. If you need to use these features, do not configure a ConnectCallback for SocketsHttpHandler and use the default HTTP transport instead."
I am not entirely sure and could use your help on the guidance here, thanks.
wadepickett
changed the title
gRPC over Named Pipes sample broken
gRPC over Named Pipes - Alternative option for client-side load balancing, channel status?
Feb 3, 2025
wadepickett
changed the title
gRPC over Named Pipes - Alternative option for client-side load balancing, channel status?
gRPC over Named Pipes - Alternative for client-side load balancing, channel status?
Feb 3, 2025
Description
Problem
When creating a basic gRPC over Named Pipes application from the code of the documentation, the code breaks with the following error code on the
channel.ConnectAsync();
.Even though there is a note about regarding the things mentioned it doesn't explain anything about how to disable.
Code
Server
Program.cs
Client
NamedPipesConnectionFactory.cs
Program.cs
Page URL
https://learn.microsoft.com/en-us/aspnet/core/grpc/interprocess-namedpipes?view=aspnetcore-9.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/grpc/interprocess-namedpipes.md
Document ID
58d486b8-0e04-9767-2089-deb43a28f56b
Article author
@JamesNK
Metadata
Related Issues
The text was updated successfully, but these errors were encountered: