Ethernet Library for Arduino
http://arduino.cc/
- C++ 95.3%
- C 4.7%
Send and flush spun forever when the peer became unreachable (cable pulled, peer moved to another network): the socket stays ESTABLISHED, the chip never transmits, so it never times out either. socketSend(), socketSendUDP() and EthernetClient::flush() now give up after 250 ms, and the two read-until-stable register loops after 16 reads. A timed out send returns 0, which callers already treat as a failed write. Ethernet.setHostname() replaces the hard-coded "WIZnet" + MAC DHCP hostname, so the router's lease list says what the device is. DHCP now requests option 42; Ethernet.ntpServerIP() returns the first NTP server offered, or 0.0.0.0. ETHERNET_FORK_VRATK0529 lets code detect this fork. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .github | ||
| docs | ||
| examples | ||
| src | ||
| .codespellrc | ||
| AUTHORS | ||
| keywords.txt | ||
| library.properties | ||
| README.adoc | ||
:repository-owner: Vratk0529
:repository-name: Ethernet
= {repository-name} Library for Arduino =
image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-arduino.yml/badge.svg["Check Arduino status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-arduino.yml"]
image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml/badge.svg["Compile Examples status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml"]
image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml/badge.svg["Spell Check status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml"]
With the Arduino Ethernet Shield, this library allows an Arduino board to connect to the internet.
For more information about this library please visit us at
https://www.arduino.cc/en/Reference/{repository-name}
== Changes in this fork ==
Drop-in replacement for arduino-libraries/Ethernet 2.0.2, used by SmartLib.
* *No more hangs when the peer disappears.* Upstream spins forever in
`socketSend()`, `socketSendUDP()` and `EthernetClient::flush()` if the cable
is pulled or the peer moves networks: the socket stays ESTABLISHED, the chip
never transmits, so it never times out either. Those waits now give up after
250 ms (a timed-out send returns 0, which callers already treat as failure),
and the two "read until stable" register loops give up after 16 reads.
* `Ethernet.setHostname("KitchenLight")` before `begin()` sends a real DHCP
hostname (option 12) instead of `WIZnetXXXXXX`, so the router's lease list
says what the device is.
* DHCP asks for NTP servers (option 42); `Ethernet.ntpServerIP()` returns the
first one, or 0.0.0.0 if the lease has none.
== License ==
Copyright (c) 2010 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA