[lwip-users] Can only one time send from server to client
From:
Mauricio brazuka
Subject:
[lwip-users] Can only one time send from server to client
Date:
Mon, 21 Aug 2006 12:29:38 +0200 (CEST)
Hello everybody! I am LwIP begginer and i try write one program with the LwIP(raw-api) but my program dont run very well. My program can send only one time the information from Server to client. Why can i write from server to client more that one time with the same connection? My program is the adaptation from the programs httpd.c and shell.c LwIP's sources.
Can someone help me please?
Thanks a lot Mauricio
First client example wrinted in Perl only to testing. This works only problem ################################################## #
Works # ################################################## $MySocket=new IO::Socket::INET->new(PeerPort=>80, Proto=>'tcp', PeerAddr=>$ip_address);
$MySocket->send("WRITE 3 4\n"); // Second command
#-------------------------------------------------
Second client example wrinted in Perl only to testing This works only one time, i can send only the first "command" and the second command is not accepted ################################################## # Dont Work # ################################################## $MySocket=new IO::Socket::INET->new(PeerPort=>80, Proto=>'tcp', PeerAddr=>$ip_address);
/* We cannot send more data than space available in the send buffer. */ if (tcp_sndbuf(pcb) < hs->left) { len = tcp_sndbuf(pcb); } else { len = hs->left; }
do { err = tcp_write(pcb, hs->respond, len, 0); /* err = tcp_write(pcb, "TESTANDO\n",11, 0); */ if (err == ERR_MEM) { len /= 2; } } while (err == ERR_MEM && len > 1);