in reply to Re^6: Joining a Thread in w While loop
in thread Joining a Thread in w While loop
Well 2 things, your $sel->can_read will always be true if the socket is connected. $input =<$sock> will block Gtk2, since it will read until $sock is closed.sub incoming_data { if ($sel->can_read(1)){ my $input = <$sock>; $input =~ s/\r\n//g;
Try
So just try a sysread in your sub until you get a non-blocking behavior, then work from there.my $input; sysread ($sock, $input, 1024); # that will not block gtk2 print $input;
|
|---|