Re: Using Gtk2::Helper->add_watch on win32


Please don't e-mail me off-list with questions; if your original
e-mail went to the list, then the list should be copied on subsequent

When I said "an example of code that demonstrates your problem", I
meant a complete, standalone Perl script that contains the minimum
amount of code necessary to demonstrate your problem.

I could probably write something with the information that you've
given me below, but I currently lack the tuits.



On Tue, May 31, 2011 at 6:32 PM, Joe <jrgpmaster gmail com> wrote:
This is the code in question, on line 87 in (see the svn
repo on sourceforge):

$self->{sock_watch} = Gtk2::Helper->add_watch (fileno $self->{sock},
'in', sub{$self->watch_callback();});

It has no effect whatsoever on windows.

This makes the socket itself:
$self->{sock} = IO::Socket::INET->new(
PeerAddr => $self->{settings}->{host},
PeerPort => $self->{settings}->{port},
Proto => 'tcp',
Timeout => 3
) || return 0;

On Tue, May 31, 2011 at 11:24 AM, Brian Manning <elspicyjack gmail com> wrote:
On Mon, May 30, 2011 at 9:04 PM, Joe <jrgpmaster gmail com> wrote:

So my perl/gtk app (
runs perfectly on Linux, Mac OSX, and FreeBSD, but on Windows
(Camelbox Perl and compiling it all from source) it doesn't work since
using Gtk2::Helper->add_watch on a network socket file descriptor
seems to have no effect.

I've searched around and the only conclusion I have found is that
pipes on Windows suck.

Pipes or sockets? ÂYou mention both. says:

"In general, don't directly access the system in code meant to be
portable. That means, no system, exec, fork, pipe, `` , qx//, open
with a |, nor any of the other things that makes being a perl hacker
worth being."

Do you have an example of code that demonstrates your problem?

Can you use a lower level construct like IO::Select or even the
select() call to watch your sockets (I'm assuming this is what you
meant above) instead of Gtk2::Helper?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]