mirror of
https://github.com/status-im/react-native-udp.git
synced 2025-01-12 10:04:21 +00:00
Fixes #14
Now forcing the host resolution to happen, which will make the UnknownHostException fire if there are problems.
This commit is contained in:
parent
bf668cd322
commit
641b9d770e
@ -74,7 +74,7 @@ public final class UdpSocketClient implements UdpReceiverTask.OnDataReceivedList
|
||||
|
||||
SocketAddress socketAddress;
|
||||
if (address != null) {
|
||||
socketAddress = new InetSocketAddress(address, port);
|
||||
socketAddress = new InetSocketAddress(InetAddress.getByName(address), port);
|
||||
} else {
|
||||
socketAddress = new InetSocketAddress(port);
|
||||
}
|
||||
@ -157,7 +157,7 @@ public final class UdpSocketClient implements UdpReceiverTask.OnDataReceivedList
|
||||
UdpSenderTask task = new UdpSenderTask(mSocket, this);
|
||||
UdpSenderTask.SenderPacket packet = new UdpSenderTask.SenderPacket();
|
||||
packet.data = data;
|
||||
packet.socketAddress = new InetSocketAddress(address, port);
|
||||
packet.socketAddress = new InetSocketAddress(InetAddress.getByName(address), port);
|
||||
|
||||
if (callback != null) {
|
||||
synchronized (mPendingSends) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user