views:

64

answers:

1

How do my program on Pocket PC (.Net CF v3.5)
can communicate with program on my Desktop (.Net application) ?

The Pocket PC is in cradle, connected via usb.

Update:
I know how to use socket to open TCP or send datagrams. I know how to use TcpClient/TcpListener.

I just don't know how to give configuration for opening sockets for this specific problem, or search for IP's to use TcpClient/TcpListener ... or ?

(i.e. how my app on pocket pc discovers the IP of the computer ?)

+1  A: 

If you read Beej's Guide to Network Programming - Using Internet Sockets you'll understand the basics in order to exhange data between 2 sockets.

ActiveSync opens a new local IP in the PC. That allows a pocket device to communicate with a remote host with sockets through the USB!

(There is also an API for the ActiveSync but I never used it)

Edit: Probably I'm wrong about the ActiveSync. You don't need it. If a pocket device is connected on the USB the OS creates a temporary LAN, eg: under the domain 169.254.2.x, so that networking can be accomplished.

Nick D
Thank you. I just understood I didn't properly formulate the question.How can I discover (from PC) which network interface is my Pocket PC after ? Or how do I determine the IP address of the Pocket PC? (and vice versa, how do I determine address of PC from the Pocket PC?)
modosansreves
@modosansreves, I don't know the proper way for that. If you use ActiveSync, the devices will get an extra IP. For example pocketpc: `169.254.2.1` and the PC: `169.254.2.2`. So they are both under the `169.254.2.x` group, which you can scan.
Nick D
... `gethostbyname("")` can give all host's local IPs.
Nick D
Amazingly these addresses worked. Thank you.
modosansreves