[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] LwIP TCP Server crashes after two accepted connections simu
From: |
julian-bauer |
Subject: |
[lwip-users] LwIP TCP Server crashes after two accepted connections simultaneously |
Date: |
Mon, 18 Feb 2019 00:28:21 -0700 (MST) |
Hello,
I have a problem with Lwip202 v1.1 baremetal at the moment. I set up an TCP
listen Server and that works. I can connect from my computer to that listen
socket, close the connection and reconnecting many times. No Problems.
The problem is if I connect a second computer and I connect first PC1 than
PC2, it works, than i disconnect PC1 and then PC2, that works too. But if I
try to connect them a second time, LwIP stucks and nothing works anymore,
then after a while I get the message:
"unable to alloc pbuf in recv_handler"
but thats a side effect of the main problem, I don't find...
when I accept the connection, I call tcp_accepted() to the global listening
pcb. I set tcp_recv() and tcp_err() callbacks and sending an "hello message"
to my connected client.
when I receive FIN, I set the tcp_recv() and tcp_err() callback to NULL and
call tcp_close(), or abort if it fails. The global listening pcb is
untouched and still listening as before.
At the end of the recv_callback I call tcp_recved(tpcb, p->tot_len) and
pbuf_free(p);
I don't know what could be wrong with the code???
--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
- [lwip-users] LwIP TCP Server crashes after two accepted connections simultaneously,
julian-bauer <=