Re: Event module

[email protected] (Peter Marelas)
Newsgroups perl.loop
Message-ID <[email protected]>
On Thu, Jun 08, 2000 at 02:17:51PM +0200, Jochen Stenzel wrote:
> Hello,
> 
> > > sub handle_client {
> > >         my $event = shift;
> > >         $event->w->private->accept();
> > > }
> > >
> > > I want to be able to pass $socket to handle_client().
> > > I though i would use private to do this.
> >
> > Try using the data() attribute instead of private().
> 
> in my opinion, the socket can be accessed directly without the data
> attribute because it's already accessible via fd:
> 
> sub handle_client
>   {
>    my $event=shift;
>    $event->w->fd->accept();
>   }

Yep, I find this is the best solution. Thanks.

Regards
Peter Marelas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.