Dont actually need Perl's Mulitcast module, therefore no need for separate message sender
This commit is contained in:
committed by
craig.p.drummond@gmail.com
parent
f32c1052ca
commit
3ef02370b6
@@ -472,7 +472,7 @@ if (ENABLE_HTTP_STREAM_PLAYBACK AND NOT ENABLE_QT5)
|
||||
endif (ENABLE_HTTP_STREAM_PLAYBACK AND NOT ENABLE_QT5)
|
||||
|
||||
if (NOT WIN32)
|
||||
install(PROGRAMS dynamic/cantata-dynamic dynamic/message-sender DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME}/scripts)
|
||||
install(PROGRAMS dynamic/cantata-dynamic DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME}/scripts)
|
||||
if (MTP_FOUND)
|
||||
target_link_libraries(cantata ${MTP_LIBRARIES})
|
||||
include_directories(${MTP_INCLUDE_DIR})
|
||||
|
||||
@@ -490,8 +490,11 @@ sub sendServerMessage() {
|
||||
$message="STATUS:STATE:${currentStatus}\nRULES:${activeRules}\nTIME:${currentStatusTime}";
|
||||
}
|
||||
my $port=$httpPort+1;
|
||||
|
||||
system("${serverSender} ${MESSAGE_GROUP}:${port} \"{CANTATA/${idString}}${message}\"");
|
||||
my $sock = IO::Socket::INET->new(Proto=>'udp', PeerAddr=>${MESSAGE_GROUP}, PeerPort=>$port);
|
||||
if ($sock && $sock->connected()) {
|
||||
$sock->send("{CANTATA/${idString}}${message}");
|
||||
eval { close $sock; }; undef $sock;
|
||||
}
|
||||
}
|
||||
|
||||
# Send message to Cantata application...
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use IO::Socket::Multicast;
|
||||
|
||||
my $sock = IO::Socket::Multicast->new(Proto=>'udp', PeerAddr=>$ARGV[0]);
|
||||
$sock->send($ARGV[1]) || die "Couldn't send: $!";
|
||||
Reference in New Issue
Block a user