2

Is there anything bad with using read() and write() on a socket fd, instead of send() and recv()? I thought about using that in my program because read() and write() are much simpler than send() and recv().

1
  • 1
    Not having a single extra parameter that you set to zero makes them "much simpler"?! Commented Sep 3, 2015 at 20:12

1 Answer 1

3

No, there's nothing wrong with it, man 7 socket tells you explicitly that you can use the standard calls on them.

Though the send and recv functions aren't really hard to use, you can just pass 0 as the flags argument to get the same behavior as plain read and write.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.