Does Socket.send send all bytes?

Ask a Question related to Ruby, Design and Development.

  1. #1

    Default Does Socket.send send all bytes?

    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 Guest

  2. Similar Questions and Discussions

    1. send data and then alter it after send
      when attaching data using send, to a published video...is it then possible to alter this data? ie: if a title for the movie was attached using...
    2. Binary data transfer with socket.send inconsisten
      We want to transfer binary data via a socket connection. To stop extended characters becoming two bytes, we set - system.useCodepage = true; This...
    3. Can' t read all bytes from Socket
      Hi I have simple client/server socket scripts that that send some data from the server to the client. It works fine, except the client can't seem...
    4. Send Message over UNIX Socket
      i have a problem to send data over an unix domain socket after the socket is created i am reading data from stdin und want to send it over socket...
    5. Socket State Before Call To Send()?
      I am having troublee determining if a socket is still connected to the remote host before I make a call to send(). I know how to determine this...
  3. #2

    Default Re: Does Socket.send send all bytes?

    >>>>> "C" == Chris Reay <mrchameleon@hotmail.com> 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 Guest

  4. #3

    Default Re: Does Socket.send send all bytes?

    ts <decoux@moulon.inra.fr> wrote in message news:<rfc8ymwflq0.fsf@moulon.inra.fr>...
    <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 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139