Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / December 2006

Tip: Looking for answers? Try searching our database.

Dns.GetHostEntry throws SocketException in WM2005, OK in PPC2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Scott - 20 Dec 2006 03:53 GMT
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?
Scott - 20 Dec 2006 04:42 GMT
GetHostEntry(String) works where String = "MyPPC" (for example), but not
"dtpt_peer"

> Using C#, .Net CF 2.0, WM 2005 on Symbol MC9090
>
[quoted text clipped - 16 lines]
>
> Can anyone shed any light on this?
Peter Foot [MVP] - 20 Dec 2006 09:43 GMT
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

Signature

Peter Foot
Device Application Development MVP
www.peterfoot.net | www.inthehand.com

> GetHostEntry(String) works where String = "MyPPC" (for example), but not
> "dtpt_peer"
[quoted text clipped - 19 lines]
>>
>> Can anyone shed any light on this?
Peter Foot [MVP] - 21 Dec 2006 15:45 GMT
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

Signature

Peter Foot
Device Application Development MVP
www.peterfoot.net | www.inthehand.com

> I've had no problems with a WM5.0 device using GetHostByName for resolving
> server names e.g.
[quoted text clipped - 26 lines]
>>>
>>> Can anyone shed any light on this?
Scott - 26 Dec 2006 22:24 GMT
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.

> 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
[quoted text clipped - 32 lines]
>>>>
>>>> Can anyone shed any light on this?
Paul G. Tobey [eMVP] - 27 Dec 2006 16:25 GMT
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.

> Thanks for replying Peter,
>
[quoted text clipped - 42 lines]
>>>>>
>>>>> Can anyone shed any light on this?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.