Help needed for Network

HARRY

Active Member
Licensed User
Longtime User
Hi,

I need to realize the following:

One device is collecting data, for the time being a PC, the other device, a PDA invites at irregular intervals the PC to send the collected data, just one integer value.

With the information in the library Help of Network I do not find to realize this.
There is stated "Another, more complex example is available on Basic4ppc site", but I cannot find that.

Can somebody help me a little bit.

Harry
 

HARRY

Active Member
Licensed User
Longtime User
Thanks Basic4Life,

Using the chit-chat sample I made quite some progress. However, I encountered a problem using that sample on two PDA's connected via my wireless LAN.

The line : IPAddress() = Client.GetIP(txtServerName.Text) results in a string as follows: fe80::223:76ff:fe45:31c6%5 ; this is very similar to the MAC address of the server being 00:23:76:45:31:C6. Of course this string is refused as IP address.

If the Client is a PC, then it works fine.

Also, if I put the server IP address in code, it works well on a PDA as Client.

Any idea what happened?

Harry
 
Last edited:

Basic4Life

Member
Licensed User
The line : IPAddress() = Client.GetIP(txtServerName.Text) results in a string as follows: fe80::223:76ff:fe45:31c6%5 ; this is very similar to the MAC address of the server being 00:23:76:45:31:C6.

What you receive appears to be an IPv6 Link-local address - Wikipedia, the free encyclopedia

I don't know why you receive that though.

When you are using the PPC to PPC and connect with entering the IP directly, do you enter an IPv4 or IPv6 IP?

As a test you could check if you can disable IPv6 routing in your router's DHCP or LAN settings and see if that fixes it until we figure out how to get the proper IP via GetIP
 

HARRY

Active Member
Licensed User
Longtime User
When you are using the PPC to PPC and connect with entering the IP directly, do you enter an IPv4 or IPv6 IP?

As a test you could check if you can disable IPv6 routing in your router's DHCP or LAN settings and see if that fixes it until we figure out how to get the proper IP via GetIP

The IP address I entered is a IPv4 address.

Nowhere in the router there is something that looks like a IPv6 address; only Ipv4 addresses!

I did some addtional tests. I have two PC's PC-1 and PC-2 and two PDA's PDA-1 and PDA-2; they are used as Server (S) or Client(C).

PC-1 as S PC-2 as C: OK
PC-2 as S PC-1 as C: OK
PDA-1 as S PDA-2 as C: IPv6 address(?)
PDA-2 as S PDA-1 as C: IPv6 address(?)
PC-1 as S PDA-1 as C: error on the statement: IPAddress() = Client etc
PC-1 as S PDA-2 as C: error on the statement: IPAddress() = Client etc
PC-2 as S PDA-1 as C: error on the statement: IPAddress() = Client etc
PC-2 as S PDA-2 as C: error on the statement: IPAddress() = Client etc
PDA-1 as S PC-1 as C: OK
PDA-2 as S PC-1 as C: OK

Other combinations gave results as expected.

So, there are 2 error situations

- When one PDA is server and the other is Client the IPv6 addresses occur

- When a PDA is Client for a PC as Server the error occurs on the statement IPAddress() = Client.GetIP(txtServerName.Text)

I hope that this additional information is helpfull to solve the problem.

Harry
 

Basic4Life

Member
Licensed User
It seems the ip resolve with a hostname is broken (at least on my ppc), I tried it in plain c# and I still get an error. Same goes for the reverse, I can't get a host alias name if I look up the ip on the device.
I don't know if it's a general issue or limited to certain devices.

The easiest work around is probably to reserve an ip for your server device in your router settings, so your server device is always assigned the same ip. Then you can simply connect to that.
Of course, if the server device isn't always the same one, that wouldn't work.
 

HARRY

Active Member
Licensed User
Longtime User
In my router I assigned a fixed IP to the PDA I normally will use and coded that IP in the program. I also added the option in that program to use a different IP. For the time being it is the best solution.
Thanks for your help.
Harry
 
Top