Re: Dns.GetHostEntry throws SocketException in WM2005, OK in PPC2003



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?










.



Relevant Pages

  • Re: Dns.GetHostEntry throws SocketException in WM2005, OK in PPC2003
    ... able to use PocketPing to verify that the connection is there. ... pointer address in attempting to use a pointer argument in a call ... The SocketException contains an ErrorCode that equates to ... an invalid pointer value, or if the length of the buffer is too small. ...
    (microsoft.public.dotnet.framework.compactframework)
  • 10.1 - resolving hostnames slow for the first time
    ... I have encountered a very strange problem with 10.1 on my laptop. ... 30s or something like this when estabilishing SSH connection etc. ... Sometimes it even takes so long to resolve something, ... the hostname, then the result gets cached and the hostname is resolved ...
    (alt.os.linux.suse)
  • Re: Passing in SqlConnection by ref
    ... My concern was if I pass in connection to another method, ... it in with "ref" to accomplish that. ... less do the same thing (it's a true pointer as oppose to reference type). ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Passing in SqlConnection by ref
    ... My concern was if I pass in connection to another method, ... it in with "ref" to accomplish that. ... less do the same thing (it's a true pointer as oppose to reference type). ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: APQ
    ... > must be compatible with the license of APQ. ... > allocated when the connection is created. ... It should *be* a smart pointer. ... each database is registered in a global list, ...
    (comp.lang.ada)