DNS.RESOLVE does not work from ethernet card

G

Guest

Hello
This problem is driving me crazy: - Here is the situation in my c# compact framework (VS.net 2003

Address ipAddress = IPAddress.Parse(Dns.Resolve(vsServerIP).AddressList[0].ToString())
IPEndPoint ipLocalEndPoint = new IPEndPoint(ipAddress,viPortNumber);
1) Above code (DNS.resolve) works perfectly In emulato

2) But when PDA is connected using ETHERNET ADAPTER(application is launched in PDA), this code (Dns.resolve) throws SocketException. (inner exception . "THIS IP ADDRESS IS NOT VALID IN IT'S CONTEXT

3) PDA works if IP(numeric) is supplied instead of machine name (i.e without using DNS.resolve)

Please help me out... this is driving me mad. Just FYI, the PDA Pings properly for IP address assigned... and while debugging i am connected to my machine using machine name
(BTW it does not work even in NON DEBUG MODE. ie. by application itself)

REALLY NEED HELP

Hars
 
P

Paul G. Tobey [eMVP]

Why don't you break that huge expression into separate steps and take a look
at the results of each step before the exception occurs? That is, do the
DNS.Resolve(vsServerIP), tell us what the vsServerIP is (if it's the IP
assigned by ActiveSync, obviously it's not going to work or if it's PPP_PEER
or something like that it's not going to work). When you get back the
address entry, browse through it in the debugger and see what's there,
especially AddressList[ 0 ], etc.

Paul T.

Harsh said:
Hello,
This problem is driving me crazy: - Here is the situation in my c#
compact framework (VS.net 2003)
Address ipAddress =
IPAddress.Parse(Dns.Resolve(vsServerIP).AddressList[0].ToString()) ;
IPEndPoint ipLocalEndPoint = new IPEndPoint(ipAddress,viPortNumber);
1) Above code (DNS.resolve) works perfectly In emulator

2) But when PDA is connected using ETHERNET ADAPTER(application is
launched in PDA), this code (Dns.resolve) throws SocketException. (inner
exception . "THIS IP ADDRESS IS NOT VALID IN IT'S CONTEXT"
3) PDA works if IP(numeric) is supplied instead of machine name (i.e without using DNS.resolve).

Please help me out... this is driving me mad. Just FYI, the PDA Pings
properly for IP address assigned... and while debugging i am connected to my
machine using machine name.
 
G

Guest

Paul, Thanks for reply... But i have checked what u said already... It is Dns.Resolve that throws the socket exception..

Please understand this works from EMULATOR .... but not from PDA when connected throgh Active Sync or Ethernet card

Hars
 
G

Guest

Paul/All,

Dns.Resolve(vsServerIP) (this step takes nearly 30-60 seconds
Here vsServerIP = “Harshawardhan†in my case… it is the machine name where my server application is running

and throws the socket exception mentioned

Hars
 
P

Paul G. Tobey [eMVP]

And you failed to tell us what the value of vsServerIP is when it fails.
Remember that the emulator is not the device (in any case), so it does not
surprise me *at all* that it does something different there...

Paul T.

Harsh said:
Paul, Thanks for reply... But i have checked what u said already... It is
Dns.Resolve that throws the socket exception...
Please understand this works from EMULATOR .... but not from PDA when
connected throgh Active Sync or Ethernet card.
 
P

Paul G. Tobey [eMVP]

And what DNS server is resolving that for you? I'm not having any trouble
resolving a host name on the local network where my CE device is located to
an IP address...

Paul T.

Harsh said:
Paul/All,

Dns.Resolve(vsServerIP) (this step takes nearly 30-60 seconds)
Here vsServerIP = "Harshawardhan" in my case. it is the machine name where
my server application is running.
 
P

Paul G. Tobey [eMVP]

And, by the way, what version of the .NET CF are you using? I'm using SP2
on my Windows CE.NET 4.2 (not PPC), device...

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top