2

I am playing around with linux network programming and I wrote a little client server app which bounces a small message between a client and a server process and measures the round trip time. Consistently I see around 80ms for localhost round trip (this is after connection setup). This seems extraordinarily high. The same machine running the same code will clock substantially below 1ms on Vista.

Any ideas on where this difference could come from? The code is pretty straightforward, accept on one end, connect on the other and then just send/receive through the peer socket.

I am just begining on Linux, apologies if this is a silly question.

4

1 回答 1

6

如果您正在使用 TCP 套接字,那么您可能想要禁用 Nagle 算法(通过设置 TCP_NODELAY 套接字选项)。

于 2009-08-20T06:55:07.630 回答