lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] I find a very strange question about the tcp connetcions.


From: steelen
Subject: [lwip-users] I find a very strange question about the tcp connetcions.
Date: Fri, 22 Feb 2008 20:35:05 +0800

I find a very strange question about the tcp connections.

 

I use Luminary LM3S8962,and I use the Lwip1.2.0 ported by Luminary.

I define The max tcp  connection is 4

the pbuf size is 256  and  the pbuf number is 32

 

But I find a very strange question for each connection I can receive 9 package of less the 512 bytes more than 256  bytes and 18 package of l less than 256 bytes ,then no receive at all . If the 4 connection is all used , It can receive nothing from the Lwip Tcp.

Can someone give me answers ? and why ? and how to solve this question .

 

The source show like this

 

static err_t  my_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err )

{

  char *rq;

  INT16U i;

  if(p != NULL)

  {

       rq = p->payload;

      ……..

 

      pbuf_free(p);

       com1_led_on();

  }

 

  return ERR_OK;

}

static err_t  my_accept(void *arg, struct tcp_pcb *pcb, err_t err)

{

 

tcp_recv(pcb, my_recv);

 

 return ERR_OK;

}

void monitor_init( void)

{

  struct tcp_pcb *pcb;

 

  monitor.ornt_state=0;

  pcb = tcp_new();

  tcp_bind(pcb, IP_ADDR_ANY, 23);

  pcb = tcp_listen(pcb);

  tcp_accept(pcb,my_accept);

 

}       

 

 

 

Steelen

 

 


reply via email to

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