[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] One more context of execution question
From: |
shogun |
Subject: |
[lwip-users] One more context of execution question |
Date: |
Sun, 12 Dec 2010 18:30:18 -0500 |
I have one more question about what is safe to run in different execution
context for lwip (interrupt/thread). I did add an OS to my application and
now moved some things around so data is only sent and received in the tcp/ip
thread context. Is it recommended I move any of the following API calls to
LWIP into the tcp/ip thread context also? The following two functions are
the callbacks to the accept of a new connection and the last function is a
function that can be called to close a socket upon an error etc. I did move
"pcb->flags |= TF_NODELAY;" to the tcp/ip thread but I am looking for advice
if I should move the registering of the callbacks and or the tcp_abore() and
or tcp_close() etc to the tcp/ip thread also.
//The accept callback
static err_t main_accept(void *arg, struct tcp_pcb *pcb, err_t err)
{
tcp_err(pcb, main_socket_error);
tcp_recv(pcb, main_recv);
pcb->flags |= TF_NODELAY; //turn off Nagle (this was
moved to the tcp/ip thread)
tcp_sent(mainNetInfoStruct.pcb, main_sent_callbackClear);
return ERR_OK;
}
//Called when there is an unrecoverable error etc
static void close(struct tcp_pcb *pcb)
{
tcp_abort(pcb);
tcp_close(pcb);
}
Thanks for all the help!
DB
- [lwip-users] One more context of execution question,
shogun <=