Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!ucsd!usc!pollux.usc.edu!kjh From: kjh@pollux.usc.edu (Kenneth J. Hendrickson) Newsgroups: comp.unix.wizards Subject: Re: sockets Keywords: sockets, primer Message-ID: <24957@usc.edu> Date: 28 May 90 10:44:03 GMT References: <24943@usc.edu> <102572@convex.convex.com> Sender: news@usc.edu Organization: EE-Systems, Univ. of So. Calif., Los Angeles Lines: 19 After much debugging (about 12 hours or so), I have discovered that I am pushing bytes through the sockets that I have created as expected, but there is a small problem. read(socket, buf, sizeof(buf)) is always returning sizeof(buf), even though that many characters weren't necessarily read into buf. The man pages say something about ioctl(), and using "STREAMS message-nondiscard" mode, but I can't figure out how to do this. If I can get read() to return the correct value (the number of bytes actually read from the socket), then I feel I will be 98% done with the debugging of my program. Please help. If you know how to make read() work correctly, please let me know. Thanks. P.S. The sockets are AF_UNIX and SOCK_STREAM. They are created, bind()ed with a path name, listen()ing for a connection, connect()ed to, accept()ing a connection, and bytes go across both ways just like they should. However, read() doesn't work right as described above. Ken Hendrickson N8DGN/6 kjh@usc.edu ...!uunet!usc!pollux!kjh