How to get response data by socket connections in native C code? #6886
Replies: 1 comment
-
Posted at 2017-03-23 by @gfwilliams You can't write code that blocks waiting for input. It needs to use callbacks. I'm not quite sure what you're trying to do, but this looks like it'd be an awful lot easier in JavaScript! Posted at 2017-03-23 by Aifer @gfwilliams Posted at 2017-03-23 by @gfwilliams Personally I'd figure out which bit of the current module is slow (probably the masking) and implement just that part. But if you did want to implement a WS module you'd be better off adding the functionality to Posted at 2017-03-23 by Aifer @gfwilliams Posted at 2017-03-23 by Aifer Hi, @gfwilliams I try you suggestion, result is here: http://forum.espruino.com/conversations/302083/#comment13541177 Thanks! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-03-23 by Aifer
ESP32 module, WIFI connected.
In C native code , I send datas to a server by a socket connection.
The server receives the data correctly, then it sends a response string "hello client" to ESP32.
I use waitForInput to detect response data, but it always return FASLE.
And, should I use the following function to receive data?
Beta Was this translation helpful? Give feedback.
All reactions