sockets
Kenneth J. Hendrickson
kjh at pollux.usc.edu
Mon May 28 20:44:03 AEST 1990
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 at usc.edu ...!uunet!usc!pollux!kjh
More information about the Comp.unix.wizards
mailing list