lwip-users
[Top][All Lists]
Advanced

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

RE : [lwip-users] Problem with socket send()


From: Frédéric BERNON
Subject: RE : [lwip-users] Problem with socket send()
Date: Wed, 22 Aug 2007 11:05:15 +0200

Hi,

Can you disable the nagle algorithm to be sure? (in this case, you should also 
have 3 frames, but, if the problem is in segment concatenation, you should got 
good datas)

About your sample, since you write :

send(SmtpState.iSocket, "012345",  5, 0); // Send_1

You should got "abdcdefgh01234ABCDEF" (without the "5"). Right?
  
====================================
Frédéric BERNON 
HYMATOM SA 
Chef de projet informatique 
Microsoft Certified Professional 
Tél. : +33 (0)4-67-87-61-10 
Fax. : +33 (0)4-67-70-85-44 
Email : address@hidden 
Web Site : http://www.hymatom.fr 
====================================
P Avant d'imprimer, penser à l'environnement
 


-----Message d'origine-----
De : address@hidden [mailto:address@hidden De la part de Winformatik Info
Envoyé : mercredi 22 août 2007 10:15
À : Mailing list for lwIP users
Objet : [lwip-users] Problem with socket send()


Hi

I have written a SMTP client and used the socket programming. I did the 
programming with an old version of lwIP (prior 1.20 but newer than 
1.10... I think). With this version the SMTO client works like expected. 
After switching to the latest CVS HEAD the SMTP client does not work 
well any more.
The problem happens if the SMTP code calls 3 times the send() function, 
one after another and only if any of the first two calls of send() is 
called with a odd number of bytes to send, like (pseudo code):

send(SmtpState.iSocket, "abcdefgh", 8, 0); // Send_0 send(SmtpState.iSocket, 
"012345",  5, 0); // Send_1 send(SmtpState.iSocket, "ABCDEF", 6, 0); // Send_2

If the "Send_1" would be called with an even number of bytes the problem 
does not occur.

After recording the frames with the Wireshark software. I found, that 
the three calls of send() resulting in one frame which is send over the 
Ethernet (I use a CS8900 Ethernet chip with 16Bit access). But the data 
content of the this frame seems to be wrong. It looks like :

"abdcdefgh012345 ABCDEF" instead of "abdcdefgh012345ABCDEF"

It seems, that the different buffers (or the data inside) used by the 
three send() calls are not merged the right way. I tracked down the 
problem to the functions tcp_output() and tcp_output_segment(), but the 
code is very difficult to understand.

BTW: If I insert a time-out (I use a RTOS) between the send() calls the 
data is send correct, of course in separate frames.

I did verified the problem on to different architectures (a H8S and an 
ARM7 Hardware; means a 16- and a 32-bit system). The problem is the same 
on both systems.

Does somebody have an idea what's going wrong here ? Does somebody could 
verify this behaviour ?
Thank you very much for any help.

Kind regards
Roland



_______________________________________________
lwip-users mailing list
address@hidden http://lists.nongnu.org/mailman/listinfo/lwip-users

Attachment: Frédéric BERNON.vcf
Description: Frédéric BERNON.vcf


reply via email to

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