diff options
| -rw-r--r-- | src/main/java/com/it_jaros/jns/scan/engine/platform/linux/LinuxUdpSocketAPI.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/com/it_jaros/jns/scan/engine/platform/linux/LinuxUdpSocketAPI.java b/src/main/java/com/it_jaros/jns/scan/engine/platform/linux/LinuxUdpSocketAPI.java index bbd2009..3f05b67 100644 --- a/src/main/java/com/it_jaros/jns/scan/engine/platform/linux/LinuxUdpSocketAPI.java +++ b/src/main/java/com/it_jaros/jns/scan/engine/platform/linux/LinuxUdpSocketAPI.java @@ -125,7 +125,7 @@ public class LinuxUdpSocketAPI { } } - @SuppressWarnings({"unchecked", "rawtypes"}) + @SuppressWarnings({"unchecked"}) private <T> T callNativeMethod(MethodHandle methodHandle, Object... args) throws NativeCallException { try { return (T) methodHandle.invokeWithArguments(args); @@ -135,20 +135,20 @@ public class LinuxUdpSocketAPI { } public int socket(int family) throws IOException { - return wrapNativeMethodCall(SOCKET, family, SOCK_DGRAM, 0); + return this.<Integer>wrapNativeMethodCall(SOCKET, family, SOCK_DGRAM, 0); } public void connect(int fd, MemorySegment destination) throws IOException { wrapNativeMethodCall(CONNECT, fd, destination, (int) destination.byteSize()); } - public void sendEmptyDatagram(int fd) throws IOException { + public long sendEmptyDatagram(int fd) throws IOException { MemorySegment buffer = arena.allocate(1L); - wrapNativeMethodCall(SEND, fd, buffer, buffer.byteSize(), 0); + return this.<Long>wrapNativeMethodCall(SEND, fd, buffer, buffer.byteSize(), 0); } public long recv(int fd, MemorySegment buffer) throws IOException { - return wrapNativeMethodCall(RECV, fd, buffer, buffer.byteSize(), 0); + return this.<Long>wrapNativeMethodCall(RECV, fd, buffer, buffer.byteSize(), 0); } public void setReceiveTimeout(int fd, long timeoutInMillis) throws IOException { |
