[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Quick sockets question

Vasyl Smirnov

10/23/2007 3:52:00 PM

Hi,

I wonder if it is sufficient to use read/write methods on a TCP/
UNIXSocket object if all I need to do is just send
the data to and fro?

Does it handle partial reads/write situations internally?

As far as I understand, recvfrom is necessary when you need some
specific stuff, like out-of-band data?

Confused, because Pickaxe examples use recvfrom(), and not read().

Can someone explain?

Thanks.

1 Answer

Robert Klemme

10/24/2007 8:50:00 AM

0

2007/10/23, Vasyl Smirnov <vasyl.smirnov@gmail.com>:
> Hi,
>
> I wonder if it is sufficient to use read/write methods on a TCP/
> UNIXSocket object if all I need to do is just send
> the data to and fro?
>
> Does it handle partial reads/write situations internally?
>
> As far as I understand, recvfrom is necessary when you need some
> specific stuff, like out-of-band data?
>
> Confused, because Pickaxe examples use recvfrom(), and not read().
>
> Can someone explain?

Off the top of my head I believe #recvfrom is for UDP while you want
to do TCP. And yes, #write and #read should be sufficient.

Kind regards

robert