Hello,
using pth_fdmode, set the file descriptor non-block mode works fine if the
file is regular file (e.g. local files stored in the hard disk).
When I tried read from socket w/ non-block mode, pth_recv or pth_read fail.
i.e. return value is always -1. Here's a grep of code. Any help? TIA.
morpheus:/mnt/sda1/ish/cow$ fgrep s_sock *.c
cow.c:static int s_socket;
cow.c: close (s_socket);
cow.c: if ((s_socket = socket (AF_INET, SOCK_STREAM, pe->p_proto)) == -1)
cow.c: if (bind (s_socket, (struct sockaddr *) &sar, sizeof (struct sockaddr_in))
cow.c: if (listen (s_socket, REQ_MAX) == -1)
cow.c: pth_accept (s_socket, (struct sockaddr *) &peer_addr, &peer_len)))
cow.c:// pth_fdmode(s_socket, PTH_FDMODE_NONBLOCK); //bad // BAD
cow.c: pth_accept (s_socket, (struct sockaddr *) &peer_addr,
morpheus:/mnt/sda1/ish/cow$
--
Takashi Ishihara http://wwwcsif.cs.ucdavis.edu/~ishihara
;; The first precept was never to accept a thing as true until I knew it
;; as such without a single doubt. (Rene Descartes, 1637)
______________________________________________________________________
GNU Portable Threads (Pth) http://www.gnu.org/software/pth/
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager (Majordomo) [EMAIL PROTECTED]