Search code examples
socketssendconcurrencyrecv

is it safe to recv() and send() on one socket concurrently?


I remember having read somewhere that a socket can be regarded as two independent half-duplex channels. Does it mean that recv() and send() of the same socket are actually irrelevant?

  • if so, is it by definition or implementation-specific?
  • if not, how the two interfere with each other?

thanks.


Solution

  • I'm curious how you think they would interfere with each other. Are you thinking that you might receive what you sent?