Skip to content

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

@brako

Description

@brako

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions