lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] ACK query


From: Adam Dunkels
Subject: [lwip-users] Re: [lwip] ACK query
Date: Thu, 09 Jan 2003 01:03:19 -0000

Hi Kieran!

On Monday 21 January 2002 15.48, you wrote:
> Now we have an ACK enqueued, but it's not going anywhere fast!

I'm not sure that I have found your problem, but at least I have been able to 
reproduce a similar sitation here.

I did a small program using the raw API that just listens to a port and 
receives all data that is sent to it. (The code can be found below.) 
Everything worked fine at a start - until I tried to change the return value 
from the receiver_recv() function from ERR_OK to an error such as ERR_MEM. 
Then everything started crawling just like you describe. 

Does this sound anything like your situation?

/adam

static err_t
receiver_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
{
  if(p == NULL) {
    tcp_close(pcb);
  } else {
    tcp_recved(pcb, p->tot_len);
    pbuf_free(p);
  }
  return ERR_OK;
}

static err_t
receiver_accept(void *arg, struct tcp_pcb *pcb, err_t err)
{
  tcp_recv(pcb, receiver_recv);
  return ERR_OK;
}

static void
receiver_init(void)
{
  struct tcp_pcb *pcb;

  pcb = tcp_new();
  if(pcb == NULL) {
    return;
  }
  tcp_bind(pcb, IP_ADDR_ANY, 9090);
  pcb = tcp_listen(pcb);
  tcp_accept(pcb, receiver_accept);  
}

-- 
Adam Dunkels <address@hidden>
http://www.sics.se/~adam
[This message was sent through the lwip discussion list.]




reply via email to

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