Re: Dns.GetHostEntry throws SocketException in WM2005, OK in PPC2003
- From: "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT com>
- Date: Wed, 27 Dec 2006 09:25:33 -0700
Are you sure that you're calling the method with the right signature. I've
done a resolve of PPP_PEER on a WM5 device while AS is connected and it
worked fine. The problem seems to be localized to your code.
Paul T.
"Scott" <Spam@xxxxxxxxxxxx> wrote in message
news:OZbIvyTKHHA.4000@xxxxxxxxxxxxxxxxxxxxxxx
Thanks for replying Peter,
I did have it in a try/catch and it was connected via a cable. Possibly
an issue with ActiveSync 4.5 Beta - don't know.
Incidentally, using PPP_PEER on WM2005 also throws an error; a less
serious unable to resolve address exception. This is still strange
though, as I'm able to use PocketPing to verify that the connection is
there.
"Peter Foot [MVP]" <feedback@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:CBDD1E9E-C547-4EF9-AC46-8A477A093CD6@xxxxxxxxxxxxxxxx
This will fail with a socket exception if you are not connected. So you
may need to check the network status first, either way you should wrap in
a try catch.
Peter
--
Peter Foot
Device Application Development MVP
www.peterfoot.net | www.inthehand.com
"Peter Foot [MVP]" <feedback@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:87696F6F-B99C-463F-B4F7-1E6A17764B69@xxxxxxxxxxxxxxxx
I've had no problems with a WM5.0 device using GetHostByName for
resolving server names e.g.
IPHostEntry ihe = System.Net.Dns.GetHostByName("PPP_PEER");
Peter
--
Peter Foot
Device Application Development MVP
www.peterfoot.net | www.inthehand.com
"Scott" <Spam@xxxxxxxxxxxx> wrote in message
news:Obt%23eL$IHHA.1912@xxxxxxxxxxxxxxxxxxxxxxx
GetHostEntry(String) works where String = "MyPPC" (for example), but
not "dtpt_peer"
"Scott" <Spam@xxxxxxxxxxxx> wrote in message
news:eWcq5p%23IHHA.3668@xxxxxxxxxxxxxxxxxxxxxxx
Using C#, .Net CF 2.0, WM 2005 on Symbol MC9090
IPHostEntry Dns.GetHostEntry (String)
Throws:-
{System.Net.Sockets.SocketException: The system detected an invalid
pointer address in attempting to use a pointer argument in a call
at System.Net.Dns.ResolveInternal()
at System.Net.Dns.GetHostEntry()
The SocketException contains an ErrorCode (0x0000271e) that equates to
the following socket error:-
The system detected an invalid pointer address in attempting to use a
pointer argument of a call. This error occurs if an application passes
an invalid pointer value, or if the length of the buffer is too small.
For instance, if the length of an argument, which is a sockaddr
structure, is smaller than the sizeof(sockaddr).
The same call works on PPC 2003.
Can anyone shed any light on this?
.
- References:
- Dns.GetHostEntry throws SocketException in WM2005, OK in PPC2003
- From: Scott
- Re: Dns.GetHostEntry throws SocketException in WM2005, OK in PPC2003
- From: Scott
- Re: Dns.GetHostEntry throws SocketException in WM2005, OK in PPC2003
- From: Peter Foot [MVP]
- Re: Dns.GetHostEntry throws SocketException in WM2005, OK in PPC2003
- From: Peter Foot [MVP]
- Re: Dns.GetHostEntry throws SocketException in WM2005, OK in PPC2003
- From: Scott
- Dns.GetHostEntry throws SocketException in WM2005, OK in PPC2003
- Prev by Date: Re: Create WiFi connection and many connection to internet by bluetooth
- Next by Date: Re: Mobile Service & Auto Start
- Previous by thread: Re: Dns.GetHostEntry throws SocketException in WM2005, OK in PPC2003
- Next by thread: Is the Dotfuscator in vs.net 2003, support the net compact framework ?
- Index(es):
Relevant Pages
|