1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-12-18 10:22:18 +03:00
Commit Graph

39 Commits

Author SHA1 Message Date
david gauchard
26980b39e3 fix #1002 ::Flush() wait for empty send buffer (#3967)
* fix #1002 ::Flush() wait for empty send buffer

* WiFiClient::Flush() guarantees that the data has been delivered
option 1 of https://github.com/esp8266/Arduino/pull/3967#discussion_r156901071
10ms max wait according to loaded tcp echo/reply scheme
2017-12-17 13:16:41 -03:00
Ivan Grokhotkov
5116a46f09 WiFiClient,WiFiServer: update to match new err_t definition 2017-10-15 01:40:10 -05:00
Ivan Grokhotkov
d6f1f0d5d7 WiFiClient: apply write timeout to single chunk (#3273)
WiFiClient write timeouts introduced in #3257 applied to the whole write
operation, which could take long time if data size was large. This
change makes the timeout happen per chunk. Timeout now happens if no
data has been delivered within a given interval.
2017-05-22 20:08:16 +08:00
Ivan Grokhotkov
eebcc656ed WiFiClient: add support for connect timeout 2017-05-19 09:35:01 -05:00
Ivan Grokhotkov
7de81270a3 ClientContext: don’t read DataSource in TCP callback
Previously, _write_some function would be called each time TCP stack
notifies the application that some data was delivered (via the `sent`
callback). In turn, _write_some would obtain more data to be sent from
the DataSource. In case of a DataSource backed by a Stream, this would
read from a stream. Some libraries (such as SD) may call `yield` and
other blocking operations from Stream read function, which can not be
used in TCP stack callbacks.

This change moves the data sending loop back into the Arduino task, with
a negligible loss of performance. TCP callback now wakes the main task
via `esp_schedule`, which performs stream read and provides more data
to the TCP stack.

Possible future optimization would be to buffer Stream data ahead of
time. That way, buffered data could be sent immediately from the TCP
callback. On the other hand, this optimization would need extra TCP_MSS
of temporary storage, per connection.

Fixes #2399.
2017-05-09 06:17:32 -05:00
david gauchard
a41f55c469 prepare lwip2 (#3129)
* minimum changes for libraries to compile with lwip2

* add WiFiClient::availableForWrite() (similar to Serial::) which indicates how much data can be sent without buffering
2017-04-25 08:55:01 -05:00
joelucid
61787b23af ClientConnection uses too much heap when streaming files #2871 (#2874)
* ClientConnection uses too much heap when streaming files #2871

* make write_chunk_size a member variable

* untabify
2017-01-31 11:04:45 +03:00
Rodion Kvashnin
2126146e20 Fix warnings (#2881)
* Suppressed -Wunused-parameter and -Wunused-function by casting to void unused identifiers.

* Explicit initialization of all fields to suppress -Wmissing-field-initializers.

* Fixed signed/unsigned integer comparison.

* memset initialization of structs.

* More -Wunused-parameter fixes.
2017-01-31 10:07:59 +03:00
Ivan Grokhotkov
8db4dcea42 WifiClient::write refactoring (second attempt) (#2177)
* WiFiClient: use DataSource for writes

* ESP8266WebServer: delegate writing to WiFiClient

* ESP8266WebServer: set write timeout before sending content
2016-06-23 17:47:18 +08:00
Ivan Grokhotkov
a2b82ed6b6 Use gcc-built LwIP by default (#1926)
It is still possible to use xcc-built LwIP by selecting "Core Development" board from tools menu.
2016-05-06 20:09:15 +08:00
Ivan Grokhotkov
33e5ca44df WiFiClient: fix write behaviour when connection is closed by remote side
Don't wait for data to be ACKed if we have just called abort().
2016-03-02 17:53:42 +03:00
Ivan Grokhotkov
efc8dda160 Workaround for LwIP not handling ERR_ABRT
Described in detail here: https://github.com/esp8266/Arduino/wiki/LwIP-issue,-or-how-a-simple-%22if%22-can-go-wrong
2016-01-26 15:57:37 +03:00
Markus Sattler
5333ebfed7 add function peekBytes to WiFiClient/WiFiClientSecure to allow to peek multiple bytes if possible 2015-12-19 14:37:36 +01:00
Me No Dev
a44632b8cf make compiler happier 2015-11-25 18:11:16 +02:00
Markus Sattler
c8aac83c47 add :del message to unref 2015-11-22 22:39:58 +01:00
Ivan Grokhotkov
6b7b802706 Fix a crash due to abort() called from TCP error callback (#428) 2015-09-28 16:05:23 +03:00
aalku
acc34e2914 LocalIP/LocalPort support 2015-08-19 13:18:43 +03:00
Markus Sattler
874cf0ef98 fix exception 28 in AP + STA mode and STA disconnect
UDP triggers exception 28
2015-06-20 18:36:19 +02:00
Ivan Grokhotkov
c51acf2a32 Fix tcp error handler 2015-06-11 18:11:26 +03:00
ficeto
f2f1fad298 add TCP_NODELAY control 2015-05-12 19:25:37 +03:00
ficeto
1707d3d036 move discard_cb to unref 2015-05-12 14:22:16 +03:00
ficeto
88c6ee418d add close and abort methods and enable disconnect callback 2015-05-12 13:58:05 +03:00
ficeto
8819c1e91c fix write taking too long 2015-05-07 13:38:32 +03:00
Markus Sattler
0bd2ea1948 remove some warnings 2015-04-06 19:54:01 +02:00
Markus Sattler
f165a0afcd use Eclipse auto Format to get rip auf the tab, space and code style inconsistency 2015-04-06 19:33:50 +02:00
Markus Sattler
3bb2de4a85 add flush() to unref() see #50 2015-04-06 19:17:19 +02:00
Markus Sattler
3c7eaafeaf force tcp close in error 2015-04-06 18:55:21 +02:00
Markus Sattler
ea7a4e522a add null prt check to _pcb in flush 2015-04-06 18:49:57 +02:00
Markus Sattler
96ec8e480b add size check to write
some more debug output
2015-04-06 18:41:44 +02:00
Markus Sattler
53dbeeb0aa add error reason to WiFiClient debug
handle tcp_close error in unref()
2015-04-02 18:57:28 +02:00
Ivan Grokhotkov
ea90d3ce92 Fix WiFiClient assignment operator 2015-02-16 03:02:42 +03:00
Ivan Grokhotkov
b09e8e593a Add remoteIP and remotePort methods to WiFiClient 2015-01-16 17:56:11 +03:00
Ivan Grokhotkov
7d1de31896 Fix call to tcp_recved after pcb has been closed, abort connections closed by the remote side 2015-01-13 09:10:32 +03:00
Ivan Grokhotkov
ccfbd9c969 WiFiClient cleanup 2014-12-29 10:37:11 +03:00
Ivan Grokhotkov
55f07f1e08 TCP client flow control 2014-12-29 01:20:07 +03:00
Ivan Grokhotkov
2328e07637 Fix memory leak in WiFiClient 2014-12-23 12:34:41 +03:00
Ivan Grokhotkov
6c344ffbb1 Update license headers in files that were completely rewritten 2014-12-19 01:40:47 +03:00
Ivan Grokhotkov
b4f21fc6b0 Implement most WiFi functions
Need to update to SDK 0.9.3 because DHCP client functions are missing
2014-12-05 22:39:40 +03:00
Ivan Grokhotkov
6d9c77ebe1 Add ESP8266WiFi library 2014-12-01 00:36:56 +03:00