ttt_status_t status;
struct sockaddr_in addr;
int socket;
+ int flags;
*socket_ret = -1;
shutdown (socket, SHUT_RDWR);
return status;
}
-
+ flags = fcntl(socket, F_GETFL);
+ flags |= O_NONBLOCK;
+ fcntl(socket, F_SETFL, flags);
*socket_ret = socket;
return TTT_STATUS_SUCCESS;
}
/* Exported: see ttt-socket.h for documentation. */
-void
+ssize_t
ttt_socket_read (int socket,
void *buf,
size_t count)
int bytes_read;
char *cbuf = buf;
- while (count) {
bytes_read = xread (socket, cbuf, count);
- cbuf += bytes_read;
- count -= bytes_read;
- }
+ return(bytes_read);
}
/* Exported: see ttt-socket.h for documentation. */