SocketException connecting to SFTP server: name is valid, but no data of the requested type was found

萝らか妹 提交于 2019-12-08 08:03:52

问题


I am trying to connect my sftp server using SharpSsh library, but I'm getting following error:

System.Net.Sockets.SocketException (0x80004005):
The requested name is valid, but no data of the requested type was found

I am using following code for connection

Tamir.SharpSsh.Sftp sftp = new Tamir.SharpSsh.Sftp("ftp.simptr.us", "username", "password");

Why is this exception being thrown?


回答1:


This error message is associated with the Winsock WSANO_DATA error code. It means, there is some problem with DNS record of the domain name you are trying to connect to.

See also
https://docs.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2#WSANO_DATA

It is unlikely this is related to the SharpSsh library.

Try to telnet to verify, you should get the same error:

telnet ftp.simptr.us 22


来源:https://stackoverflow.com/questions/15260111/socketexception-connecting-to-sftp-server-name-is-valid-but-no-data-of-the-req

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!