From: Dirk Koopman Date: Sun, 13 Sep 2020 13:10:27 +0000 (+0100) Subject: get wsjtx to work X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=b9241950296fe353177143eb3cdb02de6f9929f2;p=spider.git get wsjtx to work --- diff --git a/perl/WSJTX.pm b/perl/WSJTX.pm index 389b8b21..16f7b64a 100644 --- a/perl/WSJTX.pm +++ b/perl/WSJTX.pm @@ -10,16 +10,23 @@ use warnings; use 5.22.1; use JSON; +use DXDebug; my $json; +sub new +{ + return bless {}, 'WSJTX'; +} + sub handle { my ($self, $handle, $data) = @_; my $lth = length $data; dbgdump('udp', "UDP IN lth: $lth", $data); - + return 1; + } sub finish diff --git a/perl/wsjtl.pl b/perl/wsjtl.pl index 2fabfe9e..e6f1c048 100644 --- a/perl/wsjtl.pl +++ b/perl/wsjtl.pl @@ -71,7 +71,7 @@ use DXUDP; use WSJTX; our $udp_host = '0.0.0.0'; -our $udp_port = 2237; +our $udp_port = 59387; # 2237; our $tcp_host = '::'; our $tcp_port = 2238; @@ -89,11 +89,25 @@ dbgadd('udp'); $uh = DXUDP->new; $uh->start(host => $udp_host, port => $udp_port) or die "Cannot listen on $udp_host:$udp_port $!\n"; -$wsjtx = WSJTX->new(); -$uh->on(read => sub {wstjx->handle(@_)}); +$wsjtx = WSJTX->new; +$uh->on(read => \&_read); Mojo::IOLoop->start() unless Mojo::IOLoop->is_running; +sub _read +{ + my ($handle, $data) = @_; + +# say "before handle"; + + $wsjtx->handle($handle, $data); + +# say "after handle"; + +# my $lth = length $data; +# dbgdump('udp', "UDP IN lth: $lth", $data); +} + exit;