Does Socket.send send all bytes?

Discussion in 'Ruby' started by Chris Reay, Nov 3, 2003.

  1. Chris Reay

    Chris Reay Guest

    Does ruby's Socket.send send all bytes at once, or does one have to
    keep count of bytes sent and repeat sending until all are sent (a la C
    etc)?
     
    Chris Reay, Nov 3, 2003
    #1
    1. Advertisements

  2. Chris Reay

    ts Guest

    >>>>> "C" == Chris Reay <> writes:

    C> Does ruby's Socket.send send all bytes at once, or does one have to
    C> keep count of bytes sent and repeat sending until all are sent (a la C
    C> etc)?

    Just try it

    svg% ruby -rsocket -e 'p TCPSocket.new("ruby-lang.org", 80).send("1" * 81920, 0)'
    33304
    svg%


    --

    Guy Decoux
     
    ts, Nov 4, 2003
    #2
    1. Advertisements

  3. Chris Reay

    Chris Reay Guest

    ts <> wrote in message news:<>...
    <snip>
    > Just try it
    >
    > svg% ruby -rsocket -e 'p TCPSocket.new("ruby-lang.org", 80).send("1" * 81920, 0)'
    > 33304
    > svg%


    Fair comment :) Thanks!
     
    Chris Reay, Nov 4, 2003
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason Collins
    Replies:
    3
    Views:
    6,313
    Jason Collins
    Feb 18, 2004
  2. mrby

    4-bytes or 8-bytes alignment?

    mrby, Nov 2, 2004, in forum: C Programming
    Replies:
    8
    Views:
    693
    Mark McIntyre
    Nov 2, 2004
  3. Replies:
    5
    Views:
    797
    Flash Gordon
    Apr 9, 2006
  4. charvind
    Replies:
    0
    Views:
    800
    charvind
    Jul 2, 2007
  5. Laszlo Nagy
    Replies:
    1
    Views:
    6,956
    Mark Wooding
    Jan 27, 2009
  6. Steve Holden
    Replies:
    1
    Views:
    971
  7. Ashwin Rao
    Replies:
    2
    Views:
    1,272
    Martien Verbruggen
    Dec 3, 2009
  8. Steven D'Aprano
    Replies:
    1
    Views:
    396
    Chris Angelico
    Jan 7, 2013
Loading...