#ruby-lang - Wed 28 Mar 2007 between 00:47 and 00:54

LoganCapaldoOn my box (OS X) it says The MSG_PEEK flag causes the receive operation to
return data from the beginning of the receive queue without removing that
data from the queue.
So it looks like its effectively reading, without consuming it
And not so much giving you a length number
But I dunno
raleighwhat i had in mind didn't involve MSG_PEEK
i wanted s.recv(large_number) # don't block if it doesn't fill
teferiLoganCapaldo: yeah, I know
LoganCapaldo: I'm talking about the number that returns
raleigh: I think you want s.read_nonblock
raleighoh ok, thanks
i thought you were joking earlier
teferiwhy would I joke about something like that?
LoganCapaldowell if s.recv(large_number) # don't block was what you _wanted_ why did you ask how to tell how much stuff was there to be read?
Also, I'm the only one who makes jokes about apis ;)
raleighrecv(large_number) is how i would do it in c
teferiwell, this ain't C
but thats not what you _asked_ for
raleighright, for instance, in actionscript, the socket sets bytesAvailable
which is much easier to use
teferithis also ain't actionscript :)
tansakuhi all - is there a particular reason why ruby has to explicitly convert to strings, e.g. 6 + 'hello' fails and 6.to_s + 'hello' works
LoganCapaldotansaku: You want that behavior
teferitansaku: yes, because a string is not an integer
and an integer is not a string
this will not be changed. ever.
LoganCapaldo6 + '23' # what happens now?
teferithis is a good thign.
tansakuLoganCapaldo: defaulting to string conversion would be good for me
teferino it wouldn't
every time your language does an implicit conversion, God kills a kitten
please, think of the kittens
tansakuI guess php must have killed a lot of kittens
imperatorand lobsters
teferithere are mass graves full of the victims of php
LoganCapaldo"#{6}hello" is cooler anyhow

Page: 2 9 16 23 30 37 44 51 58 65