flok
Well-known member
Hi,
I'm trying to port an application of mine to the teensy 4.1. Compiling and linking is no problem but networking is problematic (for me at least ).
I have two sockets:
What I then do is:
The UDP handling works fine: in 1 a millisecond I prepare a response and send it back. Using lots of Serial.println() I verified that my UDP code is non-blocking.
Now the tcp part on the other hand doesn't work at all. It listens for a connection, connection gets setup but it never reaches the accept() part it looks like: if (c) never evaluates to true.
What can it be?
(p.s. the whole project can be found at https://github.com/folkertvanheusden/iESP/blob/teensy4.1/ESP32/com-arduino.cpp#L89 )
I'm trying to port an application of mine to the teensy 4.1. Compiling and linking is no problem but networking is problematic (for me at least ).
I have two sockets:
- one listens on a UDP port
- one listens on a TCP port
What I then do is:
C++:
EthernetServer *server = new EthernetServer(port);
server->begin();
EthernetUDP *handle = new EthernetUDP();
handle->begin(161);
for(;;) {
int rc = handle->parsePacket();
if (rc) {
// handle udp packet
}
Ethernet.maintain();
auto c = server->accept();
if (c) {
// handle tcp session
}
}
The UDP handling works fine: in 1 a millisecond I prepare a response and send it back. Using lots of Serial.println() I verified that my UDP code is non-blocking.
Now the tcp part on the other hand doesn't work at all. It listens for a connection, connection gets setup but it never reaches the accept() part it looks like: if (c) never evaluates to true.
What can it be?
(p.s. the whole project can be found at https://github.com/folkertvanheusden/iESP/blob/teensy4.1/ESP32/com-arduino.cpp#L89 )
Last edited: