if (( s = socket( AF_INET, SOCK_STREAM, 0 )) < 0 ) {
DO_RETURN( -1 );
}
+#ifdef TCP_NODELAY
+ {
+ int tmp = 1;
+ if( setsockopt( s, IPPROTO_TCP, TCP_NODELAY,
+ &tmp, sizeof(tmp) ) == -1 )
+ {
+ Debug( LDAP_DEBUG_ANY,
+ "setsockopt(TCP_NODELAY failed on %d\n",
+ s, 0, 0 );
+ }
+ }
+#endif
#ifdef notyet
status = 1;
if ( async && ioctl( s, FIONBIO, (caddr_t)&status ) == -1 ) {
{
int err = errno;
Debug( LDAP_DEBUG_ANY,
- "slapd(%ld): setsockopt() failed errno %d (%s)\n",
+ "slapd(%ld): setsockopt(SO_REUSEADDR) failed errno %d (%s)\n",
(long) l.sl_sd, err,
err > -1 && err < sys_nerr
? sys_errlist[err] : "unknown" );
{
int err = errno;
Debug( LDAP_DEBUG_ANY,
- "slapd(%ld): setsockopt(KEEPALIVE) failed errno %d (%s)\n",
+ "slapd(%ld): setsockopt(SO_KEEPALIVE) failed errno %d (%s)\n",
+ (long) l.sl_sd, err,
+ err > -1 && err < sys_nerr
+ ? sys_errlist[err] : "unknown" );
+ }
+#endif
+#ifdef TCP_NODELAY
+ tmp = 1;
+ if ( setsockopt( l.sl_sd, IPPROTO_TCP, TCP_NODELAY,
+ (char *)&tmp, sizeof(tmp) ) )
+ {
+ int err = errno;
+ Debug( LDAP_DEBUG_ANY,
+ "slapd(%ld): setsockopt(TCP_NODELAY) failed errno %d (%s)\n",
(long) l.sl_sd, err,
err > -1 && err < sys_nerr
? sys_errlist[err] : "unknown" );