# Quick sockets question

**URL:** <https://www.ruby-forum.com/t/quick-sockets-question/118064>\
**Category:** Ruby\
**Created:** [October 23, 2007, 5:55pm UTC](https://www.ruby-forum.com/t/quick-sockets-question/118064 "2007-10-23T17:55:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vasyl\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/4bbf92/32.png) [@Vasyl\_S](https://www.ruby-forum.com/u/Vasyl_S)\
**Post date:** [October 23, 2007, 5:55pm UTC](https://www.ruby-forum.com/t/quick-sockets-question/118064/1 "2007-10-23T17:55:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Vasyl\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/4bbf92/32.png) [@Vasyl\_S](https://www.ruby-forum.com/u/Vasyl_S)\
**Post date:** [October 24, 2007, 10:52am UTC](https://www.ruby-forum.com/t/quick-sockets-question/118064/2 "2007-10-24T10:52:09Z")

</div>

2007/10/23, Vasyl S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> 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
