From: Francis Cianfrocca Date: 2006-09-06T01:02:22+09:00 Subject: Re: C socket to Ruby socket On 9/5/06, Andre Nathan wrote: > Hello > > What is the correct way to convert a C socket (int) to a Ruby Socket > object in a C extension? Something like > > int s = socket(...); > VALUE sock = rb_some_func(s); > > In my extension there's a callback function that receives a socket as an > argument, and I'd like to pass that socket as an argument to a ruby > block, so I need to convert it to a Socket object first. > > Thanks in advance, > Andre > > > does it need to be a Socket? class IO can be initialized with a file descriptor.