[comp.sys.apollo] Socket buffer size on the Apollo

putnam@gandalf.nosc.mil (Michael D. Putnam) (07/11/90)

I am attempting to set the buffer size of a socket on an Apollo
running Aegis 10.2 (BSD4.3).  The following example program 
should change the send buffer size:

  #include <sys/types.h>
  #include <sys/socket.h>
  #include <netdb.h>
  #include <stdio.h>   

  main()
  {
  int numbites = 4;
  int sizeofsize, size, sock;
  
  sock =socket(AF_INET, SOCK_STREAM, 0);
  
  sizeofsize = sizeof(size);
  getsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char *)&size, &sizeofsize);
  printf("Size of send buffer %d\n", size);
                                  
  setsockopt (sock, SOL_SOCKET, SO_SNDBUF, (char *)&numbites, sizeof(numbites));
  
  sizeofsize= sizeof(size);
  getsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char *)&size, &sizeofsize);
  printf("Size of send buffer %d\n", size);
  
  close (sock);
  }


When run on a VAX with BSD4.3 the following output is produced:

  Size of send buffer 4096
  Size of send buffer 4


When this program is run on my Apollo DN4500 the output is:

  Size of send buffer 0
  Size of send buffer 0

Does any one know what's happening on the Apollo?  On my project I actually
do want a small buffer size, but even though the Apollo thinks it's socket 
buffers are of `zero size' they behave as if they have a large buffer.  Any
help would be greatly appreciated.

                                                 

                                                Mike Putnam
                                                Naval Ocean Systems Center
                                                San Diego, Ca

                                                Internet: putnam@nosc.mil
                                                UUCP: sdcsvax!noscvax!putnam