ewhitt has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; use IO::Socket; use threads; system("clear"); print "Server Listening on tcp/7890\n"; my $lsn = new IO::Socket::INET( Listen => '10', LocalPort => '7890', Proto => 'tcp', ReUse => 1, ) or die $!; sub do_stuff { my $sock = shift; print "Client connected\n"; while( my $input = <$sock> ) { chomp( $input ); print "$input\n"; } print "Client disconnected\n"; } threads->create( \&do_stuff, $lsn->accept, )->detach while 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Bus Error from threading IO::Socket
by snoopy (Curate) on Aug 12, 2008 at 02:35 UTC | |
|
Re: Bus Error from threading IO::Socket
by jethro (Monsignor) on Aug 12, 2008 at 02:10 UTC | |
|
Re: Bus Error from threading IO::Socket
by Perlbotics (Archbishop) on Aug 12, 2008 at 10:55 UTC | |
|
Re: Bus Error from threading IO::Socket
by BrowserUk (Patriarch) on Aug 12, 2008 at 17:09 UTC | |
|
Re: Bus Error from threading IO::Socket
by zentara (Cardinal) on Aug 12, 2008 at 16:43 UTC |