Question:
Linux sockets - read\write() vs send\recv()?
payne747
2009-02-14 09:34:23 UTC
Hi all,

Just wondering if there's any good Linux sockets programmers who can tell me the difference between using Linux send() and recv() compared to read() and write() when using sockets? So far I've been using send() recv(), but very hard to get used to when recv() is supposed to return!
Three answers:
zoot661
2009-02-14 12:41:56 UTC
extracted from http://www.faqs.org/faqs/unix-faq/socket/ - has some very good information on sockets - i may be able to answer some more specific questions



From Andrew Gierth (andrew@erlenstar.demon.co.uk):



read() is equivalent to recv() with a flags parameter of 0. Other

values for the flags parameter change the behaviour of recv().

Similarly, write() is equivalent to send() with flags == 0.



It is unlikely that send()/recv() would be dropped; perhaps someone

with a copy of the POSIX drafts for socket calls can check...



Portability note: non-unix systems may not allow read()/write() on

sockets, but recv()/send() are usually ok. This is true on Windows and

OS/2, for example.
roznowski
2016-11-06 06:08:02 UTC
i take advantage of a Mac and that i think of that's great. Key issues to observe concerning to the Mac: that's a steep gaining knowledge of curve coming from a homestead windows based gadget. that's in basic terms a sprint greater high priced than your homestead windows gadget. The courses you record won't artwork natively on the mac. The Mac does show you how to place in homestead windows on it as nicely, so which you would be able to run the homestead windows applications. there's a version of microsoft workplace (observe, excel and so forth...) for the Mac. stable tip: i could advise going into your interior of sight apple shop and having a look at a 21" iMac or a fifteen" MacBook professional (later is a working laptop or computing gadget, former a private computing gadget). i do no longer understand plenty approximately Linux. i like my Mac (some could say a sprint too plenty) and that i could advise it to every person. have you ever seen upgrading your laptop hardware tona quicker gadget and boosting the working equipment to homestead windows 7? could be a sprint greater finances friendly. desire this helps!
No Picture
2009-02-14 09:44:24 UTC
Why move over to linux?stick to xp and vista!


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...