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

SocketException: The requested name is valid, but no data of the requested type was found #206

Open
brako opened this issue Jan 9, 2025 · 0 comments

Comments

@brako
Copy link

brako commented Jan 9, 2025

The bug

Hi! When I try to connect with the client on my local server everything works fine, but when I use my cloud environment I have the following error:

TestSocket: Failed to connect to Unspecified/some.domain.com:443
System.Net.Sockets.SocketException (11004): The requested name is valid, but no data of the requested type was found.
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|285_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at SuperSocket.Client.SocketConnector.ConnectAsync(EndPoint remoteEndPoint, ConnectState state, CancellationToken cancellationToken)

Library version

v1.0.0-beta.5

Reproduction Steps

using WebSocket = WebSocket4Net.WebSocket;

var ws = new WebSocket("wss://some.domain.com/");
ws.Headers.Add("Sec-WebSocket-Extensions", "permessage-deflate; client_max_window_bits");

//Throws the exception here
await ws.OpenAsync(cancellationToken).ConfigureAwait(false);

Additional Information

If I use ws://localhost:8080 instead, the issue is not happening.

Looks like it may be related to a DNS lookup issue, but I am not sure why since the native websocket is able to connect without issue.

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

1 participant