Comments (3)
the error I found 'hidden in plain sight' was not an error, but my confusion about if (*this)
(which executes the bool operator). I replaced it with if (data)
and after I realized my misunderstanding of if (*this)
I changed it back.
UIPClient::operator bool()
{
UIPEthernetClass::tick();
return data && (!(data->state & UIP_CLIENT_REMOTECLOSED) || data->packets_in[0] != NOBLOCK);
}
data is not null if the client is initialized.
!(data->state & UIP_CLIENT_REMOTECLOSED)
is that it is connected
data->packets_in[0] != NOBLOCK
is that it has data.
so it is initialized and (connected or has_data)
if (*this)
is used to skip available(), peek(), read() and discardReceived() (which is flush() n UIPEthernet).
from ethernetenc.
The "fix" really did solve the problem in my case. The idea that I had was that the fix prevented
dereferencing an invalid pointer, which generally results in difficult to understand bugs.
I am very fluent in C but not so much with C++. I tried to get GDB running on the ESP chip but
was not successful, so debugging required using printf. Can you suggest some debug test that
I can do to help find this problem.
from ethernetenc.
the difference is tick()
and this part of the bool operator implementation:
(!(data->state & UIP_CLIENT_REMOTECLOSED) || data->packets_in[0] != NOBLOCK)
instead of *this
in available(), peek(), read() try
data && (!(data->state & UIP_CLIENT_REMOTECLOSED) || data->packets_in[0] != NOBLOCK)
this will remove tick()
from available(), peek(), read()
from ethernetenc.
Related Issues (20)
- Problems with first sends using EthernetENC HOT 6
- Problem getting http data at 256th char HOT 1
- Enc28j60 Hangs or freeze HOT 5
- Limitation of length in UDP ? HOT 8
- Sending UDP message Error HOT 7
- [FR] Project Examples for PlatformIO Registry HOT 1
- not pingable after a while HOT 12
- conflict with webthing HOT 1
- Usage with earlephilhower / arduino-pico
- Use pico-w with EthernetENC and WiFi problem HOT 1
- can esp32-s2 use this library ? HOT 1
- Can I integrate this lib. with esp32 HTTPClient? HOT 1
- Request setting custom hostName HOT 1
- STM32F103C8 After Inactive Connection.
- trying to send broadcast SSDP message HOT 2
- Problem by traffic through switches HOT 3
- Ping command with ENC28J60 + D1 mini Wemos ESP8266 HOT 3
- no function `ethernet.MACAddress()` to drop-in replace ethernet.h HOT 2
- Port Reuse on TCP Connections HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ethernetenc.