pmarcinkiew / iotjs

Platform for Internet of Things with JavaScript http://www.iotjs.net
Other
0 stars 1 forks source link

TCP/IP and other async APIs need critical refactor #43

Open tosyu opened 6 years ago

tosyu commented 6 years ago

Most of them pass memory pointer to the data that needs to be send, not taking into account GC which can sweep the data before request finishes, this will lead to errors

pmarcinkiew commented 6 years ago

WiFi configuration guide for test:

>wifi startsta
>wifi join SSID password
>ifconfing wl1 up
>ifconfig wl1 192.168.1.4
pmarcinkiew commented 6 years ago

Configuration with DHCP:

TASH>>wifi join YOUR_NETWORK your_password
*****************************************************************
* Samsung System LSI wifi application for t20                   *
*****************************************************************
Link call back handles registered - per default!
Joining network YOUR_NETWORK
Security: wpa2_aes
Passphrase: your_password
1262304347.857961: wl1: Associated with ae:5f:3e:ec:42:51
1262304347.917835: wl1: WPA: Key negotiation completed with ae:5f:3e:ec:42:51 [PTK=CCMP GTK=CCMP]
1262304347.917835: wl1: CTRL-EVENT-CONNECTED 
Connected to network: bssid: ae:5f:3e:ec:42:51, ssid: YOUR_NETWORK
Successfully joined the network with SSID YOUR_NETWORK
TASH>>
TASH>>ifconfig wl1 dhcp
IP address 192.168.43.87
Netmask 255.255.255.0
Gateway 192.168.43.1
Default DNS 192.168.43.1
TASH>>
pmarcinkiew commented 6 years ago

I tested test_dgram_broadcast.js and it clearly sends UDP package over network with setBroadcast called but message is not received by listening sockets.

> iotjs /rom/test/run_pass/test_dgram_broadcast.js

Wireshark receives UDP package over WiFi.