Skip to content
New issue

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

NetTcp does not working #23

Open
anatoliipp opened this issue Sep 12, 2022 · 2 comments
Open

NetTcp does not working #23

anatoliipp opened this issue Sep 12, 2022 · 2 comments

Comments

@anatoliipp
Copy link

Which sample is the bug for
https://github.com/CoreWCF/samples/tree/main/Scenarios/Getting-Started-with-CoreWCF/NetCoreServer
https://github.com/CoreWCF/samples/tree/main/Scenarios/Getting-Started-with-CoreWCF/NetCoreClient

Describe the bug
When I tried to use NetTcpBindings I received an error:
On the client side:
There was no endpoint listening at net.tcp://localhost:8089/EchoService/netTcp that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
On the server side:
Now listening on: http://[::]:8088
Now listening on: https://[::]:8443
Now listening on: http://0.0.0.0:8089
Application started. Press Ctrl+C to shut down.
fail: Microsoft.AspNetCore.Server.Kestrel[0]
Unhandled exception while processing 0HMKKHCH4NHRG.
System.NullReferenceException: Object reference not set to an instance of an object.
at CoreWCF.Channels.Framing.FramingModeHandshakeMiddleware.OnConnectedCoreAsync(FramingConnection connection)
at CoreWCF.Channels.Framing.FramingModeHandshakeMiddleware.OnConnectedAsync(FramingConnection connection)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.KestrelConnection.ExecuteAsync()

To Reproduce
Steps to reproduce the behavior:

  1. Run NetCoreServer
  2. Run NetCoreClient

Expected behavior
I should receive messages in consoles:
On the server side:
Received Hello World! from client!;
On the client site:
Hello World!

Repo environment (please complete the following information):

  • OS: Windows 10 Pro 21H2
  • Architecture x64
  • .NET core 3.1
  • Rider and Visual Studio

Additional context
Add any other context about the problem here.

@thanhy
Copy link

thanhy commented Nov 18, 2022

I'm also seeing the same issue on Windows 11 22H2. Is there a fix or any workaround?

@hyke123
Copy link

hyke123 commented Mar 31, 2023

AddServiceEndpoint<EchoService, IEchoService>(new NetTcpBinding(), $"net.tcp://localhost:{NETTCP_PORT}/netTcp")
var factory = new ChannelFactory<IEchoService>(binding, new EndpointAddress($"{hostAddr}/EchoService/netTcp"));

I also encountered this issue today. I believe the client's address is incorrect and should be "{hostAddr}/netTcp".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants