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()
.
Asked
Active
Viewed 170 times
2

sadljkfhalskdjfh
- 747
- 3
- 10
- 17
-
1Not having a single extra parameter that you set to zero makes them "much simpler"?! – David Schwartz Sep 03 '15 at 20:12
1 Answers
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.

Adam D. Ruppe
- 25,382
- 4
- 41
- 60