public class SunV4NativeSocket extends NativeDatagramSocket
AF_INET, AF_INET6, IP_MTU_DISCOVER, IPPROTO_ICMP, IPPROTO_ICMPV6, IPPROTO_IP, IPPROTO_IPV6, IPPROTO_UDP, IPV6_DONTFRAG, PF_INET, PF_INET6, SOCK_DGRAM, SOCK_RAW| Constructor and Description |
|---|
SunV4NativeSocket(int family,
int type,
int protocol,
int listenPort) |
| Modifier and Type | Method and Description |
|---|---|
void |
allowFragmentation(boolean frag) |
int |
bind(int socket,
sockaddr_in address,
int address_len) |
void |
close() |
int |
close(int socket) |
int |
getSock() |
int |
receive(NativeDatagramPacket p) |
int |
recvfrom(int socket,
Buffer buffer,
int buflen,
int flags,
sockaddr_in in_addr,
int[] in_addr_len) |
int |
send(NativeDatagramPacket p) |
int |
sendto(int socket,
Buffer buffer,
int buflen,
int flags,
sockaddr_in dest_addr,
int dest_addr_len) |
int |
setsockopt(int socket,
int level,
int option_name,
com.sun.jna.Pointer value,
int option_len) |
void |
setTrafficClass(int tc) |
int |
socket(int domain,
int type,
int protocol) |
allowFragmentation, create, strerrorpublic int bind(int socket,
sockaddr_in address,
int address_len)
throws com.sun.jna.LastErrorException
com.sun.jna.LastErrorExceptionpublic int socket(int domain,
int type,
int protocol)
throws com.sun.jna.LastErrorException
com.sun.jna.LastErrorExceptionpublic int setsockopt(int socket,
int level,
int option_name,
com.sun.jna.Pointer value,
int option_len)
setsockopt in class NativeDatagramSocketpublic int sendto(int socket,
Buffer buffer,
int buflen,
int flags,
sockaddr_in dest_addr,
int dest_addr_len)
throws com.sun.jna.LastErrorException
com.sun.jna.LastErrorExceptionpublic int recvfrom(int socket,
Buffer buffer,
int buflen,
int flags,
sockaddr_in in_addr,
int[] in_addr_len)
throws com.sun.jna.LastErrorException
com.sun.jna.LastErrorExceptionpublic int close(int socket)
throws com.sun.jna.LastErrorException
com.sun.jna.LastErrorExceptionpublic int getSock()
getSock in class NativeDatagramSocketpublic void setTrafficClass(int tc)
throws IOException
setTrafficClass in class NativeDatagramSocketIOExceptionpublic void allowFragmentation(boolean frag)
throws IOException
allowFragmentation in class NativeDatagramSocketIOExceptionpublic int receive(NativeDatagramPacket p)
receive in class NativeDatagramSocketpublic int send(NativeDatagramPacket p)
send in class NativeDatagramSocketpublic void close()
close in interface AutoCloseableclose in class NativeDatagramSocketCopyright © 2022. All rights reserved.