@Override public int receive(NativeDatagramPacket p) { bsd_sockaddr_in6 in_addr = new bsd_sockaddr_in6(); int[] szRef = new int[] { in_addr.size() }; ByteBuffer buf = p.getContent(); int n = recvfrom(getSock(), buf, buf.capacity(), 0, in_addr, szRef); p.setLength(n); p.setAddress(in_addr.getAddress()); p.setPort(in_addr.getPort()); return n; }
public BSDV6NativeSocket(final int family, final int type, final int protocol, final int listenPort) throws Exception { m_sock = socket(family, type, protocol); final bsd_sockaddr_in6 in_addr = new bsd_sockaddr_in6(listenPort); bind(m_sock, in_addr, in_addr.size()); }
public void setPort(int port) { byte[] p = new byte[] {(byte)(0xff & (port >> 8)), (byte)(0xff & port)}; assertLen("port", p, 2); sin6_port = p; } }
@Override public int receive(final NativeDatagramPacket p) { final bsd_sockaddr_in6 in_addr = new bsd_sockaddr_in6(); final int[] szRef = new int[] { in_addr.size() }; final int socket = getSock(); final ByteBuffer buf = p.getContent(); SocketUtils.assertSocketValid(socket); final int n = recvfrom(socket, buf, buf.capacity(), 0, in_addr, szRef); p.setLength(n); p.setAddress(in_addr.getAddress()); p.setPort(in_addr.getPort()); return n; }
public BSDV6NativeSocket(final int family, final int type, final int protocol, final int listenPort) throws Exception { m_sock = socket(family, type, protocol); final bsd_sockaddr_in6 in_addr = new bsd_sockaddr_in6(listenPort); bind(m_sock, in_addr, in_addr.size()); }
public void setPort(int port) { byte[] p = new byte[] {(byte)(0xff & (port >> 8)), (byte)(0xff & port)}; assertLen("port", p, 2); sin6_port = p; } }
@Override public int receive(final NativeDatagramPacket p) { final bsd_sockaddr_in6 in_addr = new bsd_sockaddr_in6(); final int[] szRef = new int[] { in_addr.size() }; final int socket = getSock(); final ByteBuffer buf = p.getContent(); SocketUtils.assertSocketValid(socket); final int n = recvfrom(socket, buf, buf.capacity(), 0, in_addr, szRef); p.setLength(n); p.setAddress(in_addr.getAddress()); p.setPort(in_addr.getPort()); return n; }
@Override public int send(NativeDatagramPacket p) { ByteBuffer buf = p.getContent(); bsd_sockaddr_in6 destAddr = new bsd_sockaddr_in6(p.getAddress(), p.getPort()); return sendto(getSock(), buf, buf.remaining(), 0, destAddr, destAddr.size()); }
public bsd_sockaddr_in6(int family, byte[] addr, byte[] port) { sin6_family = (byte)(0xff & family); assertLen("port", port, 2); sin6_port = port == null? null : port.clone(); sin6_flowinfo = new byte[4]; assertLen("address", addr, 16); sin6_addr = addr == null? null : addr.clone(); sin6_scope_id = new byte[4]; sin6_len = (byte)(0xff & size()); }
public void setPort(int port) { byte[] p = new byte[] {(byte)(0xff & (port >> 8)), (byte)(0xff & port)}; assertLen("port", p, 2); sin6_port = p; } }
@Override public int send(final NativeDatagramPacket p) { final ByteBuffer buf = p.getContent(); final bsd_sockaddr_in6 destAddr = new bsd_sockaddr_in6(p.getAddress(), p.getPort()); final int socket = getSock(); SocketUtils.assertSocketValid(socket); return sendto(socket, buf, buf.remaining(), 0, destAddr, destAddr.size()); }
public bsd_sockaddr_in6(int family, byte[] addr, byte[] port) { sin6_family = (byte)(0xff & family); assertLen("port", port, 2); sin6_port = port == null? null : port.clone(); sin6_flowinfo = new byte[4]; assertLen("address", addr, 16); sin6_addr = addr == null? null : addr.clone(); sin6_scope_id = new byte[4]; sin6_len = (byte)(0xff & size()); }
public void setAddress(InetAddress address) { byte[] addr = address.getAddress(); assertLen("address", addr, 16); sin6_addr = addr; } public int getPort() {
@Override public int send(final NativeDatagramPacket p) { final ByteBuffer buf = p.getContent(); final bsd_sockaddr_in6 destAddr = new bsd_sockaddr_in6(p.getAddress(), p.getPort()); final int socket = getSock(); SocketUtils.assertSocketValid(socket); return sendto(socket, buf, buf.remaining(), 0, destAddr, destAddr.size()); }
public void setAddress(InetAddress address) { byte[] addr = address.getAddress(); assertLen("address", addr, 16); sin6_addr = addr; } public int getPort() {
public void setAddress(InetAddress address) { byte[] addr = address.getAddress(); assertLen("address", addr, 16); sin6_addr = addr; } public int getPort() {