Hi,

I have a windows mobile 6 device connected to desktop thru activesync. Now
how can i get the IP address of the desktop PC inside my windows mobile
device programmatically. My intention is to make my desktop as winsock server
and the mobile device as the client.

I am able to get the IP address of the device from desktop thru active sync
APIs.

Thanks

Re: IP Address of the activesync PC by ctacke/>

ctacke/>
Wed Oct 03 07:14:53 PDT 2007

There really isn't a definitive way to do it. ActiveSync sets up it's own
virtual network, so you really can't get the IP of the PC directly. What
I'd likely do is have the desktop do a UDP broadcast of it's IP when it
detects a connection and have the device listen for that, then negotiate a
TCP connection after that.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com



"IP address of the activesync PC" <IP address of the activesync
PC@discussions.microsoft.com> wrote in message
news:CA249287-848C-4952-80AE-FF2FEF4E1438@microsoft.com...
> Hi,
>
> I have a windows mobile 6 device connected to desktop thru activesync. Now
> how can i get the IP address of the desktop PC inside my windows mobile
> device programmatically. My intention is to make my desktop as winsock
> server
> and the mobile device as the client.
>
> I am able to get the IP address of the device from desktop thru active
> sync
> APIs.
>
> Thanks



RE: IP Address of the activesync PC by srhartone

srhartone
Thu Oct 04 12:23:06 PDT 2007

If using WM5 or later with ActiveSync 4.2 or later you can in fact listen on
the loopback network endpoint on the desktop and the PPC can initiate a
connection directly. Generally the IP will be 169.254.2.2 and the device will
be 169.254.2.1.

You can read the registry to gurantee the IP of the desktop endpoint. As
Chris pointed out this is just the loopback network IP.

See this thread for more information on reading the registry:
http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/browse_thread/thread/42dda381b94f7996/dfc4ec7af3802492?lnk=gst&q=desktop+ip+simon+hart&rnum=4#dfc4ec7af3802492
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


"IP address of the activesync PC" wrote:

> Hi,
>
> I have a windows mobile 6 device connected to desktop thru activesync. Now
> how can i get the IP address of the desktop PC inside my windows mobile
> device programmatically. My intention is to make my desktop as winsock server
> and the mobile device as the client.
>
> I am able to get the IP address of the device from desktop thru active sync
> APIs.
>
> Thanks