- if (bind(ptr->hosts[0].fd, (struct sockaddr *) &localAddr, sizeof(localAddr)) < 0)
- return(MEMCACHED_CONNECTION_BIND_FAILURE);
+ /* For the moment, not getting a nonblocking mode will note be fatal */
+ if (ptr->flags & MEM_NO_BLOCK)
+ {
+ int flags;
+
+ flags= fcntl(ptr->hosts[x].fd, F_GETFL, 0);
+ if (flags != -1)
+ (void)fcntl(ptr->hosts[x].fd, F_SETFL, flags | O_NONBLOCK);
+ }
+
+ if (ptr->flags & MEM_TCP_NODELAY)
+ {
+ int flag= 1;
+
+ setsockopt(ptr->hosts[x].fd, IPPROTO_TCP, TCP_NODELAY,
+ &flag, (socklen_t)sizeof(int));
+ }