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?

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

Scott
Tue Dec 19 22:42:37 CST 2006

GetHostEntry(String) works where String = "MyPPC" (for example), but not
"dtpt_peer"

"Scott" <Spam@NoThanks.com> wrote in message
news:eWcq5p%23IHHA.3668@TK2MSFTNGP02.phx.gbl...
> 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?
>
>



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

Peter
Wed Dec 20 03:43:14 CST 2006

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@NoThanks.com> wrote in message
news:Obt%23eL$IHHA.1912@TK2MSFTNGP03.phx.gbl...
> GetHostEntry(String) works where String = "MyPPC" (for example), but not
> "dtpt_peer"
>
> "Scott" <Spam@NoThanks.com> wrote in message
> news:eWcq5p%23IHHA.3668@TK2MSFTNGP02.phx.gbl...
>> 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?
>>
>>
>
>


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

Peter
Thu Dec 21 09:45:35 CST 2006

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@nospam-inthehand.com> wrote in message
news:87696F6F-B99C-463F-B4F7-1E6A17764B69@microsoft.com...
> 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@NoThanks.com> wrote in message
> news:Obt%23eL$IHHA.1912@TK2MSFTNGP03.phx.gbl...
>> GetHostEntry(String) works where String = "MyPPC" (for example), but not
>> "dtpt_peer"
>>
>> "Scott" <Spam@NoThanks.com> wrote in message
>> news:eWcq5p%23IHHA.3668@TK2MSFTNGP02.phx.gbl...
>>> 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?
>>>
>>>
>>
>>
>


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

Scott
Tue Dec 26 16:24:58 CST 2006

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@nospam-inthehand.com> wrote in message
news:CBDD1E9E-C547-4EF9-AC46-8A477A093CD6@microsoft.com...
> 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@nospam-inthehand.com> wrote in message
> news:87696F6F-B99C-463F-B4F7-1E6A17764B69@microsoft.com...
>> 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@NoThanks.com> wrote in message
>> news:Obt%23eL$IHHA.1912@TK2MSFTNGP03.phx.gbl...
>>> GetHostEntry(String) works where String = "MyPPC" (for example), but not
>>> "dtpt_peer"
>>>
>>> "Scott" <Spam@NoThanks.com> wrote in message
>>> news:eWcq5p%23IHHA.3668@TK2MSFTNGP02.phx.gbl...
>>>> 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?
>>>>
>>>>
>>>
>>>
>>
>



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

Paul
Wed Dec 27 10:25:33 CST 2006

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@NoThanks.com> wrote in message
news:OZbIvyTKHHA.4000@TK2MSFTNGP06.phx.gbl...
> 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@nospam-inthehand.com> wrote in message
> news:CBDD1E9E-C547-4EF9-AC46-8A477A093CD6@microsoft.com...
>> 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@nospam-inthehand.com> wrote in message
>> news:87696F6F-B99C-463F-B4F7-1E6A17764B69@microsoft.com...
>>> 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@NoThanks.com> wrote in message
>>> news:Obt%23eL$IHHA.1912@TK2MSFTNGP03.phx.gbl...
>>>> GetHostEntry(String) works where String = "MyPPC" (for example), but
>>>> not "dtpt_peer"
>>>>
>>>> "Scott" <Spam@NoThanks.com> wrote in message
>>>> news:eWcq5p%23IHHA.3668@TK2MSFTNGP02.phx.gbl...
>>>>> 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?
>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>
>