I’ve seen this a few times and asked too, what’s the difference between Send & Write, Recv & Read in the RSocket API. The answer is, very simple: Both Write and Read are just wrappers over Send and Recv, providing a default value (0), for the flags parameter (the flags can specity options like reading out of band data or peeking into the available socket buffer. The default value just reads, nothing special).
IMPORT_C void Write(const TDesC8 &aDesc, TRequestStatus &aStatus);
IMPORT_C void Send(const TDesC8 &aDesc, TUint flags, TRequestStatus &aStatus);
IMPORT_C void Read(TDes8 &aDesc, TRequestStatus &aStatus);
IMPORT_C void Recv(TDes8 &aDesc, TUint flags, TRequestStatus &aStatus);
The reason its like this is probably because of the BSD Socket APIs, which have analogous functions and is for maintaining compatibility I think. It should be noted that Microsoft skipped Read/Write in Winsock, for this reason I guess.



One Response to Difference Between Send & Write, Recv & Read