Replies: 4 comments 1 reply
-
Of course I can do something like int wantToSend = someValue;
int sent = client.write(data, size);
if (sent < 0 || wantToSend < sent) {
// no space left
} But I find it more elegant to know up front. |
Beta Was this translation helpful? Give feedback.
-
Print.h states:
Looking at the implementations of |
Beta Was this translation helpful? Give feedback.
-
I see. I missed that comment somehow 🤔 I'm looking at the regular "write(data, size)" method though. That doesn't seem to be blocking (MSG_DONTWAIT) but keeps writing and ultimately tries (#defined) 10 times before returning the amount written. But then again, how to write large data? EAGAIN and EWOULDBLOCK result in zero bytes written. Should I divide the data into small chunks myself? |
Beta Was this translation helpful? Give feedback.
-
Wait, does socket send return EWOULDBLOCK only when the buffer is completely full? Or also when size is bigger then the buffer's free space? (I really should read a book about socket programming, this is completely new for me) |
Beta Was this translation helpful? Give feedback.
-
WiFiClient --> Client --> Stream --> Print.
Print defines
virtual int availableForWrite() { return 0; }
but this isn't implemented in WiFiclient so calling this method returns 0.How do you know the available space to write data to WiFiClient?
Same question for WiFiClientSecure.
Beta Was this translation helpful? Give feedback.
All reactions