> Could anybody confirm, that there is a huge difference in speed between
> the two SendStream/RecvStream methods in the following demo:

How big data you are sending? If i read your demo correctly, biggest data 
is 2048 bytes. Try your demo with much larger data, for example with 
64kB. It can be faster then small datas.

I try to better explain this problematic:

It is typical 'Delayed ACK' issue. (this kind of ACK optimalization is 
not applyed on loopback interface - on localhost you not have a problem)

'Delayed ACK' optimalization is great for increase TCP performance on WAN 
lines. But this optimalization is designed for two scenarios:

1. send-receive-send-receive-... . It is typical for handshake based 
protocols like SMTP, POP3, etc.

2. send-send-send-... (or receive, of course) It is pushing larger datas 
through TCP channel. It is used in protocols what downloading (uploading) 
larger datas like HTTP download.

Side-effect of this optimalization is cca 200ms delay on send-send-
receive scenario. It is because send-send seems to be like case 2.,  
protocol stack waiting with ACK for next send operation, but it is not 
sended. ACK is sended after 200ms timeout.

Solutions?

- disable TCP optimalizations. But it is very bad idea, because it 
slowdown your application on slower lines.

- remove send-send-receive state by call 'send' only once. If you are 
sending larger datas, you not have a problem, because larger datas are 
sended by lot of packets, not just two. Problem exists if you are sending 
two small packets and then you are waiting for reply.

Practical example how to remove 'delayed ACK' issue you can see in latest 
httpsend.pas from synasnap.

> The diffence to the Synapse "builtin" SendStream / RecvStream methods is
> only, that the ones found in "upacksock.pas" do not send the length
> indicator separately (SendInteger(si);) but pack it on top of the stream.

I know, on small sized streams my sendstream is not optimal. I never 
using this routines, so I not have a motivation for optimalization. But 
optimalization is possible, I try to made it.


--
Lukas Gebauer.

E-mail: [EMAIL PROTECTED]
WEB: http://www.ararat.cz/synapse - Synapse Delphi and Kylix TCP/IP 
Library




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
synalist-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to