lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Probem sending large files using LwIP


From: Louis Filasky
Subject: [lwip-users] Probem sending large files using LwIP
Date: Sat, 14 Jul 2007 19:24:14 +0200

Hi,
 
I would like to thank you all for your answers and more precisely Frederic Bernon. I was able to get a working code either using dhcp or not.
Now, I had encountered another problem a few weeks ago about the maximum limit size that we can send on the Virtex II Pro port using EDK.
 
For now, I'm focusing on sending files from the server because it will be the major application. I created a structure connection_state:
 
First, we couldn t send more than around 8000 bytes of data. This was fixed by changing the argument in the tcp_write function by choosing
not to copy before sending the data.
After thinking about it, I guess that increasing the Memory heap would have also fixed it, right?
 
Now, I'm facing another problem. When I send 20.000 bytes, it is working over this, it is not. One of my teammate tried and could send it to around 32.000 bytes which seem more logical as the send buffer is limited to 32*1024*1024 bytes.
Howeve, when I tried to change the value in the lwipopt.h and look around. Whatever value we tried to put, it didn t take any effect when compiling.
The value is still 32*1024*1024.
 
Do you have any hints about this? Since we're working with video stream or uncompessed data image, the size of the files is rather big and being limited
that much is not normal.
 
Below, a sample of my code and send_data function:
 
struct connection_state {
  char *data;
  u32_t left;
};  
 
void send_data(struct tcp_pcb *pcb, struct connection_state *cs)
{
  u16_t len;
  /* We cannot send more data than space available in the send buffer.*/
  if(tcp_sndbuf(pcb) < (cs->left)) {
   len = tcp_sndbuf(pcb);
  }
  else {
     len = cs->left;
  }  
 
  if(ERR_OK == tcp_write(pcb, cs->data, len, 0)) {
  cs->data += len;
  cs->left -= len;
  }
  else if(ERR_MEM == tcp_write(pcb, cs->data, len, 0)) { 
  tcp_output(pcb);
  }
 
Many thanks again,
 
Louis.


Besoin d'un e-mail ? Créez gratuitement un compte Windows Live Hotmail et bénéficiez d'un filtre antiphishing gratuit ! Windows Live Hotmail
reply via email to

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