OVH Cloud OVH Cloud

TcpChannel et DNS

1 réponse
Avatar
Jmb
Bonjour,

J'ai une application qui utilise un TcpChannel pour être à l'écoute d'un
port en remoting, j'utilise donc la déclaration suivante:
_chnl = new TcpChannel(port);

Tout fonctionne parfaitement sur des postes avec serveur DNS, mais lorsque
l'application est déployée sur des postes avec serveur WINS (sans DNS)
j'obtiens le message d'erreur suivant:

System.Net.Sockets.SocketException: The requested name is valid, but no data
of the requested type was found
at System.Net.Dns.GetHostByName(String hostName)
at System.Runtime.Remoting.Channels.CoreChannel.GetMachineName()
at System.Runtime.Remoting.Channels.CoreChannel.GetMachineIp()
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.SetupMachineName()
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(Int32 port)
at System.Runtime.Remoting.Channels.Tcp.TcpChannel..ctor(Int32 port)
at Connect.User.Server.Open(Int32 port)

Est ce que le TcpChannel est lié au DNS ou peut-on le configurer autrement?

Merci.

1 réponse

Avatar
Arnaud CLERET
Bonsoir,

En définissant la connexion à l'hote distant vous avez très certainement
utilisé son nom plutôt que son IP ? Si tel est le cas, vous pouvez résoudre
le problème en ajoutant une entrée dans le fichier "host" du serveur qui
serait du type :

-----
HoteDistant 192.168.0.1
-----

Ceci permettra au client de résoudre le nom dns directement à partir du
fichier "host" plutôt qu'en cherchant à intéroger le serveur DNS.

--
arno - http://www.dotnetguru2.org/acleret/


"Jmb" a écrit :

Bonjour,

J'ai une application qui utilise un TcpChannel pour être à l'écoute d'un
port en remoting, j'utilise donc la déclaration suivante:
_chnl = new TcpChannel(port);

Tout fonctionne parfaitement sur des postes avec serveur DNS, mais lorsque
l'application est déployée sur des postes avec serveur WINS (sans DNS)
j'obtiens le message d'erreur suivant:

System.Net.Sockets.SocketException: The requested name is valid, but no data
of the requested type was found
at System.Net.Dns.GetHostByName(String hostName)
at System.Runtime.Remoting.Channels.CoreChannel.GetMachineName()
at System.Runtime.Remoting.Channels.CoreChannel.GetMachineIp()
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.SetupMachineName()
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(Int32 port)
at System.Runtime.Remoting.Channels.Tcp.TcpChannel..ctor(Int32 port)
at Connect.User.Server.Open(Int32 port)

Est ce que le TcpChannel est lié au DNS ou peut-on le configurer autrement?

Merci.