lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Using tcp_write() outside tcp_recv callback


From: Jamie
Subject: Re: [lwip-users] Using tcp_write() outside tcp_recv callback
Date: Fri, 17 Apr 2020 01:38:19 -0700 (MST)

Morning/evening all,
I'm following up on this thread, as I'm still at a loss as to how to get
this working. I've spent the last week going back and forth on this (among
other things), and feel like I have a better understanding of the general
process now. I'm still facing the same issue, whereby data is successfully
sent out and received by the remote CPU (and the data verified), but
transmission always stops soon after commencing the lwIP function. The most
frustrating part, is the time elapsed or the amount of data sent, before the
transmission stops seems completely random, and doesn't seem affected at all
by the lwipopts options. On the other side of the transmission (the remote
CPU), I simply tally the amount (measured in bytes) of data received before
the transmission stops. I've done an extensive range of testing, whereby I
change MEM_SIZE, TCP_SND_QUEUELEN, MEMP_NUM_TCP_SEG, MEMP_NUM_PBUF, etc.,
and the amount of bytes received before transmission stops seems completely
random.I.e. when I ran the program 5 times, with the amount of data and rate
of calling tcp_write() remaining constant for each test, I received the
following bytes before transmission stopped:
4864
14
830
1943
92
I received similar values for a range of different lwipopts as mentioned
above. I don't have access to a serial output on this embedded system, so
I'm unable to use the lwIP debugging features, nor am I able to capture a
wireshark reading. I've attached a .c file showing my function which
initiates the sending of data and the tcpSent and tcpSend function. I've
removed any irrelevant code, and haven't include my tcpInit(), tcpAccept(),
etc. functions, but am happy to add them if it's deemed relevant; I'd
greatly appreciate any input :)I'm more than happy to continue 'tuning' the
lwipopts values, but I'd really like some verification that the tcp_write(),
tcpSent() and tcpSend() processes I've implemented are logical/correct, as
I've gone back and forth between so many examples, mailing list posts,
tutorials, samples, etc. over the last week or so I don't really know where
I stand anymore. I'm almost certain that they are in fact *incorrect*.It's
important to confirm my use case as well, as I think it's probably not a
common one. The someFunction() in the attached .c file is called very
frequently (potentially >1000 times per second), as it's an IRQ for a range
of hardware inputs. The IRQ simply captures a timestamp and packages it with
a couple of other characters into a string, and then sends the buffer via
lwIP. As such, each buffer being sent with tcp_write() is small (<20 bytes),
but there are a lot of them.
lwIP.c <http://lwip.100.n7.nabble.com/file/t2315/lwIP.c>  
Thanks!



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

reply via email to

[Prev in Thread] Current Thread [Next in Thread]