public SunV4NativeSocket(int family, int type, int protocol, int listenPort) throws Exception { m_sock = socket(family, type, protocol); final sockaddr_in addr_in = new sockaddr_in(listenPort); bind(m_sock, addr_in, addr_in.size()); }
public void setPort(int port) { byte[] p = new byte[] {(byte)(0xff & (port >> 8)), (byte)(0xff & port)}; assertLen("port", p, 2); sin_port = p; } }
@Override public int receive(NativeDatagramPacket p) { sockaddr_in in_addr = new sockaddr_in(); 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 receive(NativeDatagramPacket p) { sockaddr_in in_addr = new sockaddr_in(); 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 receive(NativeDatagramPacket p) { sockaddr_in in_addr = new sockaddr_in(); 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 UnixV4NativeSocket(int family, int type, int protocol, final int listenPort) throws Exception { m_sock = socket(family, type, protocol); final sockaddr_in addr_in = new sockaddr_in(listenPort); bind(m_sock, addr_in, addr_in.size()); }
public void setPort(int port) { byte[] p = new byte[] {(byte)(0xff & (port >> 8)), (byte)(0xff & port)}; assertLen("port", p, 2); sin_port = p; } }
@Override public int receive(NativeDatagramPacket p) { sockaddr_in in_addr = new sockaddr_in(); 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 SunV4NativeSocket(int family, int type, int protocol, int listenPort) throws Exception { m_sock = socket(family, type, protocol); final sockaddr_in addr_in = new sockaddr_in(listenPort); bind(m_sock, addr_in, addr_in.size()); }
@Override public int receive(NativeDatagramPacket p) { sockaddr_in in_addr = new sockaddr_in(); 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 UnixV4NativeSocket(int family, int type, int protocol, final int listenPort) throws Exception { m_sock = socket(family, type, protocol); final sockaddr_in addr_in = new sockaddr_in(listenPort); bind(m_sock, addr_in, addr_in.size()); }
public void setPort(int port) { byte[] p = new byte[] {(byte)(0xff & (port >> 8)), (byte)(0xff & port)}; assertLen("port", p, 2); sin_port = p; } }
@Override public int receive(NativeDatagramPacket p) { sockaddr_in in_addr = new sockaddr_in(); 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 Win32V4NativeSocket(int family, int type, int protocol, final int listenPort) throws Exception { m_sock = socket(family, type, protocol); final sockaddr_in addr_in = new sockaddr_in(listenPort); bind(m_sock, addr_in, addr_in.size()); }
public void setAddress(InetAddress address) { byte[] addr = address.getAddress(); assertLen("address", addr, 4); sin_addr = addr; }
@Override public int receive(NativeDatagramPacket p) { sockaddr_in in_addr = new sockaddr_in(); 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 Win32V4NativeSocket(int family, int type, int protocol, final int listenPort) throws Exception { m_sock = socket(family, type, protocol); final sockaddr_in addr_in = new sockaddr_in(listenPort); bind(m_sock, addr_in, addr_in.size()); }
public void setAddress(InetAddress address) { byte[] addr = address.getAddress(); assertLen("address", addr, 4); sin_addr = addr; }
@Override public int receive(NativeDatagramPacket p) { sockaddr_in in_addr = new sockaddr_in(); 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; }