| LoganCapaldo | On 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 |
| raleigh | what i had in mind didn't involve MSG_PEEK i wanted s.recv(large_number) # don't block if it doesn't fill |
| teferi | LoganCapaldo: yeah, I know LoganCapaldo: I'm talking about the number that returns raleigh: I think you want s.read_nonblock |
| raleigh | oh ok, thanks i thought you were joking earlier |
| teferi | why would I joke about something like that? |
| LoganCapaldo | well 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? gah Also, I'm the only one who makes jokes about apis ;) |
| raleigh | recv(large_number) is how i would do it in c |
| teferi | well, this ain't C |
| LoganCapaldo | yes but thats not what you _asked_ for |
| raleigh | right, for instance, in actionscript, the socket sets bytesAvailable which is much easier to use |
| teferi | this also ain't actionscript :) |
| tansaku | hi 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 |
| LoganCapaldo | tansaku: You want that behavior |
| teferi | tansaku: yes, because a string is not an integer and an integer is not a string this will not be changed. ever. |
| LoganCapaldo | 6 + '23' # what happens now? |
| teferi | this is a good thign. |
| tansaku | LoganCapaldo: defaulting to string conversion would be good for me |
| teferi | no it wouldn't every time your language does an implicit conversion, God kills a kitten please, think of the kittens |
| tansaku | I guess php must have killed a lot of kittens |
| teferi | yup |
| imperator | and lobsters |
| teferi | there are mass graves full of the victims of php |
| LoganCapaldo | "#{6}hello" is cooler anyhow |