* Thomas Hurst (tom.hurst / clara.net) wrote:

> ...Three puts and gets with one-time connections: 0.297782 secs
> ....Three puts and gets with a persistent connection: 0.596412 secs
> .
> Finished in 0.897749 seconds.
> 2 runs, 6 assertions, 0 failures, 0 errors
> ruby svr.rb  0.15s user 0.02s system 16% cpu 1.017 total
 
> <tries to remember how to use setsockopt()>

Blegh, IPPROTO_TCP, not SOL_TCP which is in my (online) copy of
Programming Ruby :)

Adding:

socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, true)

Everywhere results in:

...Three puts and gets with one-time connections: 0.023096 secs
....Three puts and gets with a persistent connection: 0.018341 secs
.
Finished in 0.044998 seconds.
2 runs, 6 assertions, 0 failures, 0 errors

-- 
Thomas 'Freaky' Hurst  -  freaky / aagh.net  -  http://www.aagh.net/
-
There once was a girl named Irene
Who lived on distilled kerosene
	But she started absorbin'
	A new hydrocarbon
And since then has never benzene.