dotnet / WatsonTcp

WatsonTcp is the easiest way to build TCP-based clients and servers in C#.
MIT License
599 stars 117 forks source link

2 second connection delay when specifying 'localhost' in the client. #280

Closed hitchhiker closed 9 months ago

hitchhiker commented 9 months ago

Love your project, found something odd, not sure if due to my network setup or something your end.

To test WatsonTcp, Version=6.0.5.0 / Using your example server / client code (as in vanilla connect).

Problem If you use create a client and use 'localhost' instead of '127.0.0.1' as the host the client seems to 'pause' for about 2 seconds before being able to connect.

Could be a strange NS lookup thing on my network. Could be IPV6 interaction. Could be a bug.

jchristn commented 9 months ago

Hi @hitchhiker yes this is likely a pause caused by DNS and resolution to either IPv4 or IPv6. There isn't much we can do about it, unfortunately.