"Richard L. Hamilton" <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I would like to obtain the maximum socket buffer
> > size. Solaris seems to not support _PC_SOCK_MAXBUF
> > for function fpathconf(). _PC_SOCK_MAXBUF is defined
> > by POSIX.
> >
> > Regards,
> > Shao.
>
> From the getsockopt(3socket) man page:
>
> SO_SNDBUF and SO_RCVBUF are options that adjust the normal buffer sizes
> allocated for output and input buffers, respectively. The buffer size may be
> increased for high-volume connections or may be decreased to limit the
> possible
> backlog of incoming data. The maximum buffer size for UDP is determined by
> the
> value of the ndd variable udp_max_buf. The maximum buffer size for TCP is
> determined the value of the ndd variable tcp_max_buf. Use the ndd(1M) utility
> to determine the current default values. See the Solaris Tunable Parameters
> Reference Manual for information on setting the values of udp_max_buf and
> tcp_max_buf.
Programs that use this feature use this kind of code since 25 years:
#ifdef SO_SNDBUF
while (size > 512 &&
setsockopt(STDOUT_FILENO, SOL_SOCKET, SO_SNDBUF,
(char *)&size, sizeof (size)) < 0)
size -= 512;
DEBUG1("rmtd: sndsize: %d\n", size);
#endif
size is the desired new buf size.
Jörg
--
EMail:[EMAIL PROTECTED] (home) Jörg Schilling D-13353 Berlin
[EMAIL PROTECTED] (uni)
[EMAIL PROTECTED] (work) Blog: http://schily.blogspot.com/
URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily
_______________________________________________
opensolaris-discuss mailing list
[email protected]