BPak Active Member Licensed User Longtime User Dec 5, 2015 #1 Running example supplied and get IP as fe0:0:0:0:8cbb:12bf:555b;a6a8%wlano This is not same as expected. How to get correct IP?
Running example supplied and get IP as fe0:0:0:0:8cbb:12bf:555b;a6a8%wlano This is not same as expected. How to get correct IP?
Daestrum Expert Licensed User Longtime User Dec 5, 2015 #2 Not sure what you mean by correct IP - that figure is an IPv6 address for what looks like a wireless lan adaptor (wlano is probably wlan0 meaning wireless adaptor #0) Last edited: Dec 5, 2015 Upvote 0
Not sure what you mean by correct IP - that figure is an IPv6 address for what looks like a wireless lan adaptor (wlano is probably wlan0 meaning wireless adaptor #0)
giga Well-Known Member Licensed User Longtime User Dec 5, 2015 #3 I agree with Daestrum that looks like an IPV6 address. Are you trying to retrieve IPV4? Upvote 0
rwblinn Well-Known Member Licensed User Longtime User Dec 5, 2015 #4 Hi, not sure what example you have been using, but indeed this is an inet6 address. Example: If you run on the Raspberry Pi the command $ifconfig, then you can check for the wlan adapter 0 Output like ... wlan0 Link encap:Ethernet HWaddr 74:da:38:04:ef:41 inet addr:192.168.0.39 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::76da:38ff:fe04:ef41/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:253752 errors:0 dropped:74 overruns:0 frame:0 TX packets:12089 errors:0 dropped:1 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:55444118 (52.8 MiB) TX bytes:3268764 (3.1 MiB) ... Upvote 0
Hi, not sure what example you have been using, but indeed this is an inet6 address. Example: If you run on the Raspberry Pi the command $ifconfig, then you can check for the wlan adapter 0 Output like ... wlan0 Link encap:Ethernet HWaddr 74:da:38:04:ef:41 inet addr:192.168.0.39 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::76da:38ff:fe04:ef41/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:253752 errors:0 dropped:74 overruns:0 frame:0 TX packets:12089 errors:0 dropped:1 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:55444118 (52.8 MiB) TX bytes:3268764 (3.1 MiB) ...
BPak Active Member Licensed User Longtime User Dec 5, 2015 #5 Running the Control Desktop from Android app.ControlDesktop - under Tutorials. The code supplied for B4j puts up a notification panel with the IP Address. Yes it appears to be for IP6 and not IP4. I found solution for Android with JavaObject but the same function InitializeContext is not available in B4J. Maybe someone knows how to do this in B4J? My computer is a Mac OSX with win 7 installed on Boot camp and has WiFi and Bluetooth. Last edited: Dec 5, 2015 Upvote 0
Running the Control Desktop from Android app.ControlDesktop - under Tutorials. The code supplied for B4j puts up a notification panel with the IP Address. Yes it appears to be for IP6 and not IP4. I found solution for Android with JavaObject but the same function InitializeContext is not available in B4J. Maybe someone knows how to do this in B4J? My computer is a Mac OSX with win 7 installed on Boot camp and has WiFi and Bluetooth.
BPak Active Member Licensed User Longtime User Dec 5, 2015 #6 rwblinn said: Hi, not sure what example you have been using, but indeed this is an inet6 address. Example: If you run on the Raspberry Pi the command $ifconfig, then you can check for the wlan adapter 0 Output like ... wlan0 Link encap:Ethernet HWaddr 74:da:38:04:ef:41 inet addr:192.168.0.39 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::76da:38ff:fe04:ef41/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:253752 errors:0 dropped:74 overruns:0 frame:0 TX packets:12089 errors:0 dropped:1 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:55444118 (52.8 MiB) TX bytes:3268764 (3.1 MiB) ... Click to expand... Do no have Raspberry pi. Upvote 0
rwblinn said: Hi, not sure what example you have been using, but indeed this is an inet6 address. Example: If you run on the Raspberry Pi the command $ifconfig, then you can check for the wlan adapter 0 Output like ... wlan0 Link encap:Ethernet HWaddr 74:da:38:04:ef:41 inet addr:192.168.0.39 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::76da:38ff:fe04:ef41/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:253752 errors:0 dropped:74 overruns:0 frame:0 TX packets:12089 errors:0 dropped:1 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:55444118 (52.8 MiB) TX bytes:3268764 (3.1 MiB) ... Click to expand... Do no have Raspberry pi.
Daestrum Expert Licensed User Longtime User Dec 6, 2015 #7 If you want to use IPv4 addresses try this (found on stack overflow) By using this _JAVA_OPTIONS=-Djava.net.preferIPv4Stack=true environment variable. (read about _JAVA_OPTIONS here) Just run this command on Windows cmd: setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true Click to expand... Upvote 0
If you want to use IPv4 addresses try this (found on stack overflow) By using this _JAVA_OPTIONS=-Djava.net.preferIPv4Stack=true environment variable. (read about _JAVA_OPTIONS here) Just run this command on Windows cmd: setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true Click to expand...
BPak Active Member Licensed User Longtime User Dec 6, 2015 #8 Daestrum said: If you want to use IPv4 addresses try this (found on stack overflow) Click to expand... Run program and now the value shows as 127.0.0.1 after doing as shown. Upvote 0
Daestrum said: If you want to use IPv4 addresses try this (found on stack overflow) Click to expand... Run program and now the value shows as 127.0.0.1 after doing as shown.
Erel B4X founder Staff member Licensed User Longtime User Dec 6, 2015 #9 ServerSocket.GetMyIp will return the ip4 address if such is available. So the preferIPv4Stack is not required. Is the Mac computer connected to a network? Upvote 0
ServerSocket.GetMyIp will return the ip4 address if such is available. So the preferIPv4Stack is not required. Is the Mac computer connected to a network?
BPak Active Member Licensed User Longtime User Dec 6, 2015 #10 [QUOnetwork connectiol, post: 385358, member: 1"]ServerSocket.GetMyIp will return the ip4 address if such is available. So the preferIPv4Stack is not required. Is the Mac computer connected to a network?[/QUOTE] Erel said: ServerSocket.GetMyIp will return the ip4 address if such is available. So the preferIPv4Stack is not required. Is the Mac computer connected to a network? Click to expand... No network is connected to this computer. And computer is not connected to any network. Using the preferipv4 now causes a red message to appear in all b4j progs in the Log message that is. Picked up _JAVA_OPTIONS: -Djava.net.preferIPV4Stack=true. Upvote 0
[QUOnetwork connectiol, post: 385358, member: 1"]ServerSocket.GetMyIp will return the ip4 address if such is available. So the preferIPv4Stack is not required. Is the Mac computer connected to a network?[/QUOTE] Erel said: ServerSocket.GetMyIp will return the ip4 address if such is available. So the preferIPv4Stack is not required. Is the Mac computer connected to a network? Click to expand... No network is connected to this computer. And computer is not connected to any network. Using the preferipv4 now causes a red message to appear in all b4j progs in the Log message that is. Picked up _JAVA_OPTIONS: -Djava.net.preferIPV4Stack=true.
Erel B4X founder Staff member Licensed User Longtime User Dec 6, 2015 #11 The remote desktop example requires a network to work. The commands are sent over a TCP or UDP connections. Upvote 0
The remote desktop example requires a network to work. The commands are sent over a TCP or UDP connections.
BPak Active Member Licensed User Longtime User Dec 6, 2015 #12 QUOTE="Erel, post: 385379, member: 1"]The remote desktop example requires a network to work. The commands are sent over a TCP or UDP connections.[/QUOTE] Ok. Thanks. Upvote 0
QUOTE="Erel, post: 385379, member: 1"]The remote desktop example requires a network to work. The commands are sent over a TCP or UDP connections.[/QUOTE] Ok. Thanks.
BPak Active Member Licensed User Longtime User Dec 6, 2015 #13 Daestrum said: If you want to use IPv4 addresses try this (found on stack overflow) Click to expand... Hi Daestrum. When I run B4J I now get a red message in the log window which says: Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true I guess it does no harm to my progs. Do you know of a way to undo the setting I made? Maybe it is in some INI file? Thank you. Found: ENVIRONMENT VARIABLE Last edited: Dec 7, 2015 Upvote 0
Daestrum said: If you want to use IPv4 addresses try this (found on stack overflow) Click to expand... Hi Daestrum. When I run B4J I now get a red message in the log window which says: Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true I guess it does no harm to my progs. Do you know of a way to undo the setting I made? Maybe it is in some INI file? Thank you. Found: ENVIRONMENT VARIABLE
Daestrum Expert Licensed User Longtime User Dec 7, 2015 #14 I would guess you simply run the command again but with the setting =false Upvote 0
BPak Active Member Licensed User Longtime User Dec 7, 2015 #15 I just deleted the entry in the Windows ENVIRONMENT VARIABLES. Upvote 0