Fix IPv6 support

Issue #1148
This commit is contained in:
Craig Drummond
2017-12-23 17:06:44 +00:00
parent 3779d897fa
commit 62e34c0089
2 changed files with 5 additions and 3 deletions

View File

@@ -31,6 +31,8 @@
22. Fix potential issue with missing covers when switching collections.
23. Fix opening Cantata maximized under Windows if the info view is in the
sidebar.
24. Use IO::Socket::IP and not IO::Socket::INET in cantata-dynamic to allow
usage with IPv6. Thanks to Peter Marschall
2.2.0
-----

View File

@@ -21,7 +21,7 @@
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
use IO::Socket::INET;
use IO::Socket::IP;
use POSIX;
use File::stat;
use File::Basename;
@@ -100,7 +100,7 @@ sub connectToMpd() {
$sock = new IO::Socket::UNIX(Peer => $mpdHost, Type => 0);
$connDetails=$mpdHost;
} else {
$sock = new IO::Socket::INET(PeerAddr => $mpdHost, PeerPort => $mpdPort, Proto => 'tcp');
$sock = new IO::Socket::IP(PeerAddr => $mpdHost, PeerPort => $mpdPort, Proto => 'tcp');
$connDetails="${mpdHost}:${mpdPort}";
}
if ($sock && $sock->connected()) {
@@ -1424,7 +1424,7 @@ sub writeToClient() {
}
sub httpServer() {
my $server = new IO::Socket::INET(Proto => 'tcp', LocalPort => $httpPort, Listen => SOMAXCONN, Reuse => 1);
my $server = new IO::Socket::IP(Proto => 'tcp', LocalPort => $httpPort, Listen => SOMAXCONN, Reuse => 1);
$server or die "ERROR: Unable to create HTTP socket (${httpPort}): $!";
print "Starting HTTP server on ${httpPort}\n";