wavenator has asked for the wisdom of the Perl Monks concerning the following question:
seems like it with the client the client code: -------start of code---------
sry i dont know how to make my code looks good on the page i think the problem's here :use threads; use IO::Socket::INET; my $so = new IO::Socket::INET( PeerAddr => '127.0.0.1', PeerPort => 1300, Proto => 'tcp', Reuse => 1, ); die "Socket Error: $!\n" unless $so; my $thread = threads->create("start_thread"); my $thread1 = threads->create("start_thread1"); sub start_thread { while($so->recv($txt,128)){print "server : $txt";} } sub start_thread1 { while(my $msg = <STDIN>){print $so "$msg"; } } $thread->join(); $thread1->join(); --------end of code-----------
i've already tried with $txt =<$so>while($so->recv($txt,128)){print "server : $txt";}
well need ya help btw the problem is not with the server i've tried with telnet and worked perfect
thx for help
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: socket with threads problem
by liverpole (Monsignor) on Oct 10, 2007 at 15:11 UTC | |
by wavenator (Novice) on Oct 10, 2007 at 17:59 UTC | |
by wavenator (Novice) on Oct 10, 2007 at 18:46 UTC | |
|
Re: socket with threads problem
by zentara (Cardinal) on Oct 10, 2007 at 14:41 UTC |