Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue 130 #139

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.net.InetSocketAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.nio.channels.SocketChannel;
import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -418,7 +419,7 @@ private void initializeUDPTransport() {
// setup UDP transport
try {
// where to bind (listen) address
InetSocketAddress listenLocalAddress = new InetSocketAddress(broadcastPort);
InetSocketAddress listenLocalAddress = new InetSocketAddress(InetAddress.getByName("0.0.0.0"), broadcastPort);

// where to send address
InetSocketAddress[] broadcastAddresses = InetAddressUtil.getBroadcastAddresses(broadcastPort);
Expand All @@ -432,7 +433,7 @@ private void initializeUDPTransport() {
BlockingUDPConnector searchConnector = new BlockingUDPConnector(this, false, broadcastAddresses, true);

searchTransport = (BlockingUDPTransport) searchConnector.connect(null, new ClientResponseHandler(this),
new InetSocketAddress(0), PVAConstants.PVA_PROTOCOL_REVISION, PVAConstants.PVA_DEFAULT_PRIORITY);
new InetSocketAddress(InetAddress.getByName("0.0.0.0"), 0), PVAConstants.PVA_PROTOCOL_REVISION, PVAConstants.PVA_DEFAULT_PRIORITY);

// set broadcast address list
if (addressList != null && addressList.length() > 0) {
Expand Down Expand Up @@ -478,7 +479,7 @@ private void initializeUDPTransport() {
broadcastTransport.start();
searchTransport.start();

} catch (ConnectionException ce) {
} catch (ConnectionException | UnknownHostException ce) {
logger.log(Level.SEVERE, "Failed to initialize UDP transport.", ce);
}
}
Expand Down