Thor Lancelot Simon
2007-07-05 05:38:05 UTC
I have an application that makes outbound TCP connections at a very high
rate, so high that the overhead of additional system calls to set socket
options considerably impacts performance.
I could partially address this by adding a system call that sets multiple
socket options at once (which, I think, would be a better API than
setsockopt() anyway) but that gets rid of _all but one_ system call to
set up the socket before connect(); I want to get rid of them all.
I'd like to make it possible to set options on one "template" or "master"
socket and then have them inherited by children, as listen()/accept() make
possible for the other direction. I'm thinking of something along the lines
of this:
int socketfrom(int template, int domain, int type, int protocol);
Which would return a new socket using the socket options already set on
socket "template". If domain, type, and protocol don't match, this is
an error (or perhaps it would be best to omit them entirely and just
have one argument, the template socket.
Opinions?
rate, so high that the overhead of additional system calls to set socket
options considerably impacts performance.
I could partially address this by adding a system call that sets multiple
socket options at once (which, I think, would be a better API than
setsockopt() anyway) but that gets rid of _all but one_ system call to
set up the socket before connect(); I want to get rid of them all.
I'd like to make it possible to set options on one "template" or "master"
socket and then have them inherited by children, as listen()/accept() make
possible for the other direction. I'm thinking of something along the lines
of this:
int socketfrom(int template, int domain, int type, int protocol);
Which would return a new socket using the socket options already set on
socket "template". If domain, type, and protocol don't match, this is
an error (or perhaps it would be best to omit them entirely and just
have one argument, the template socket.
Opinions?
--
Thor Lancelot Simon ***@rek.tjls.com
"The inconsistency is startling, though admittedly, if consistency is to
be abandoned or transcended, there is no problem." - Noam Chomsky
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Thor Lancelot Simon ***@rek.tjls.com
"The inconsistency is startling, though admittedly, if consistency is to
be abandoned or transcended, there is no problem." - Noam Chomsky
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de