Difference Between Send & Write, Recv & Read

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.

Advertisements

Free Web Hosting, Never, Ever Again

This is a story of greed, grief and stupidity. And yes, the story is all mine. It all started with the usual story, a quest to save a few dollars. Obviously, the Internet can be a pretty good place for that, so good that you stumble upon the holy grail of savings, totally free services. Yep I know, you must be saying already Heh! What a looser. Trust me, its one of those very obvious pitfalls that you know will obviously end up in tragedy and you still go ahead (obviously!) knowing the obvious. Continue reading