i am in need of setting some socket options. specifically, i am interested in setting send and receive socket level buffer sizes. these numbers can affect network throughput performance significantly. i am writing some high performance network apps and the lack of socket option API is getting in the way. i could import shared library but i think perhaps newLISP needs these things in the socket API. that allows more portable way of setting options (winsock and BSD style )
any thoughts?
setsockopt / getsockopt
-
- Posts: 72
- Joined: Sun Jun 11, 2006 8:02 pm
- Location: berkeley, california
- Contact:
you can easily import setsockopt() from libc, on OS X:
all parameters except for optionPtr are streight forward integers. The option value is passed as a ptr. So you would do:
and then pass optionPtr as the parameter and option length would be 4.
Lutz
Code: Select all
> (import "libc.dylib" "setsockopt")
setsockopt <95446B74>
>
Code: Select all
(set 'optionPtr (pack "ld" SO_SNDBUF))
Lutz