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().

sadljkfhalskdjfh
  • 747
  • 3
  • 10
  • 17

1 Answers1

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