strange WiFiClient write behavior
Posted: Wed May 17, 2017 4:36 am
Hi,
I have a strange behavior when sending data through WiFiClient.
I receive data from a callback function and send the data through a socket.
Somehow the callback seems to be async and the socket should be in sync, but the client->write function
returns before hand, see blow:
thus, the function returns 0 written bytes as a return code, and the kernel does acknowledge the ":send 420"
at a later point. Here an example of a successful send in sync:
What could cause this behavior?
Best
M
I have a strange behavior when sending data through WiFiClient.
I receive data from a callback function and send the data through a socket.
Somehow the callback seems to be async and the socket should be in sync, but the client->write function
returns before hand, see blow:
Code: Select all
send_sock(): -->
:wr
:ww
send_sock(): FAILED: send 0 of amount of 420 bytes. connected 1. available 0
[u]send_sock(): 0 <--[/u]
[b]:sent 420[/b]
thus, the function returns 0 written bytes as a return code, and the kernel does acknowledge the ":send 420"
at a later point. Here an example of a successful send in sync:
Code: Select all
send_sock(): -->
:wr
[b]:sent 10[/b]
:ww
[u]send_sock(): 10 <--[/u]
What could cause this behavior?
Best
M