ip@mill.me.toronto.edu () (08/29/88)
Can someone give me a hand on this?? The following are what my programs are doing. I would apprecicate it if someone could explain to me how communication is done through the socket and what actually does FIONBIO do to the socket. Thank you in advance. /bevis Side A: <served by exec/tcp service> read from stdin until EOF write to stdout exit Side B: (Problem : couldn't read the output from Side A) sock = rexec(..., 0); ioctl(sock, FIONBIO, &one); write(sock, buf, BUFSIZ); write(sock, "\0377", 1); while((i = read(sock, buf, BUFSIZ)) > 0) write(1, buf, i); Also tried: (same problem) sock = rexec(..., 0); for(;;) { rfd = wfd = 1<<sock; if (select(sock+1, &rfd, &wfd, 0) < 0) break; if (wfd) {write(sock, buf, BUFSIZ); write(sock, "\0377", 1);} if (rfd) { while((i=read(sock, buf, BUFSIZ) > 0) write(1, buf, i); break; } } -- Bevis Ip University of Toronto, Dept. of Mechanical Engineering CSNET : ip@me.toronto.edu BITNET: ip@me.UTORONTO ARPA : ip%me.toronto.edu@relay.cs.net UUCP : {allegra,decwrl,decvax!utcsri pyramid,uunet!utai}!me!ip