[Linuxtuples-devel] socket shutdown
Brought to you by:
wware
From: Bram S. <br...@sa...> - 2006-05-10 16:16:28
|
Hi, To improve the efficiency, i've added socket shutdown calls to linuxtuples. These are very appropriate in the linuxtuples case, because you can shutdown each direction separately. This is such a good match, because linuxtuples communications are typically two-stage affairs: client opens connection client sends tuple (template) client receives tuple client closes connection after the client send stage (which is a server recv stage), the client can advise its peer that no more sending will be done. Similarly, the server can advise its peer that no more listening will be done. Using this scheme, I noticed that all the TIME_WAIT sockets move from server-side to client-side, where they do less harm (because the burden is shared by multiple clients). Moreover, the socket FAQ also recommends shutdown() prior to close() so they should be in there in anycase. Also, I've added more rigorous error checking and error printing. This helps in cases where tuple-rate is extremely high, causing the OS to deplete its socket address space. Once a repo is back up, i'll commit this. bram -- Bram Stolk, VR Engineer SARA, Amsterdam. tel +31 20 592 3000 "Windows is a 32-bit extension to a 16-bit graphical shell for an 8-bit operating system originally coded for a 4-bit microprocessor by a 2-bit company that can't stand 1 bit of competition." |