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(NativeDatagramPacket p) throws UnknownHostException { sun_sockaddr_in6 in_addr = new sun_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 SunV6NativeSocket(int family, int type, int protocol, final int listenPort) throws Exception { m_sock = socket(family, type, protocol); final sun_sockaddr_in6 in_addr = new sun_sockaddr_in6(listenPort); bind(m_sock, in_addr, in_addr.size()); }
@Override public int receive(NativeDatagramPacket p) throws UnknownHostException { sun_sockaddr_in6 in_addr = new sun_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 SunV6NativeSocket(int family, int type, int protocol, final int listenPort) throws Exception { m_sock = socket(family, type, protocol); final sun_sockaddr_in6 in_addr = new sun_sockaddr_in6(listenPort); bind(m_sock, in_addr, in_addr.size()); }
@Override public int receive(NativeDatagramPacket p) throws UnknownHostException { sun_sockaddr_in6 in_addr = new sun_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; }
@Override public int send(NativeDatagramPacket p) { ByteBuffer buf = p.getContent(); sun_sockaddr_in6 destAddr = new sun_sockaddr_in6(p.getAddress(), p.getPort()); return sendto(getSock(), buf, buf.remaining(), 0, destAddr, destAddr.size()); }
@Override public int send(NativeDatagramPacket p) { ByteBuffer buf = p.getContent(); sun_sockaddr_in6 destAddr = new sun_sockaddr_in6(p.getAddress(), p.getPort()); return sendto(getSock(), buf, buf.remaining(), 0, destAddr, destAddr.size()); }
@Override public int send(NativeDatagramPacket p) { ByteBuffer buf = p.getContent(); sun_sockaddr_in6 destAddr = new sun_sockaddr_in6(p.getAddress(), p.getPort()); return sendto(getSock(), buf, buf.remaining(), 0, destAddr, destAddr.size()); }
public void setPort(int port) { byte[] p = new byte[] {(byte)(0xff & (port >> 8)), (byte)(0xff & port)}; assertLen("port", p, 2); sin6_port = p; } }
public void setPort(int port) { byte[] p = new byte[] {(byte)(0xff & (port >> 8)), (byte)(0xff & port)}; assertLen("port", p, 2); sin6_port = p; } }
public void setAddress(InetAddress address) { byte[] addr = address.getAddress(); assertLen("address", addr, 16); sin6_addr = addr; }
public void setAddress(InetAddress address) { byte[] addr = address.getAddress(); assertLen("address", addr, 16); sin6_addr = addr; }
public void setAddress(InetAddress address) { byte[] addr = address.getAddress(); assertLen("address", addr, 16); sin6_addr = addr; }