+#ifdef __sun__
+ /* On Suns, you must set a bigger Receive Buffer BEFORE a call to connect
+ * This gives the connect a chance to negotiate with the other side
+ * (see 'man tcp')
+ */
+ if ( getsockopt(h->iofile, SOL_SOCKET, SO_RCVBUF, (void *)&recbuflen, &rbufsize ) < 0 )
+ {
+ h->cerrno = CSYSERR;
+ return -1;
+ }
+ TRC(fprintf( stderr, "Current Size of TCP Receive Buffer= %d\n",
+ recbuflen ));
+ recbuflen *= 10; /* lets be optimistic */
+ if ( setsockopt(h->iofile, SOL_SOCKET, SO_RCVBUF, (void *)&recbuflen, rbufsize ) < 0 )
+ {
+ h->cerrno = CSYSERR;
+ return -1;
+ }
+ if ( getsockopt(h->iofile, SOL_SOCKET, SO_RCVBUF, (void *)&recbuflen, &rbufsize ) )
+ {
+ h->cerrno = CSYSERR;
+ return -1;
+ }
+ TRC(fprintf( stderr, "New Size of TCP Receive Buffer = %d\n",
+ recbuflen ));
+#endif