in reply to Re^6: Joining a Thread in w While loop
in thread Joining a Thread in w While loop

I don't know, you are asking people to make your script work, and you just kind of slapped together some code, without an understanding of the basics of sockets, and it's big and complicated. I would want to be paid to work out all your bugs....but

sub incoming_data { if ($sel->can_read(1)){ my $input = <$sock>; $input =~ s/\r\n//g;
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.

Try

my $input; sysread ($sock, $input, 1024); # that will not block gtk2 print $input;
So just try a sysread in your sub until you get a non-blocking behavior, then work from there.

I'm not really a human, but I play one on earth. Cogito ergo sum a bum