UnixSocketAddress() { address = SockAddrUnix.create(); address.setFamily(ProtocolFamily.PF_UNIX); }
UnixSocketAddress() { address = SockAddrUnix.create(); address.setFamily(ProtocolFamily.PF_UNIX); }
private void readObject(ObjectInputStream o) throws IOException, ClassNotFoundException { o.defaultReadObject(); String path = (String)o.readObject(); if (null == address) { address = SockAddrUnix.create(); } address.setPath(path); address.setFamily(ProtocolFamily.PF_UNIX); } }
public UnixSocketAddress(java.io.File path) { address = SockAddrUnix.create(); address.setFamily(ProtocolFamily.PF_UNIX); address.setPath(path.getPath()); }
public UnixSocketAddress(java.io.File path) { address = SockAddrUnix.create(); address.setFamily(ProtocolFamily.PF_UNIX); address.setPath(path.getAbsolutePath()); }
public UnixSocketAddress(final String path) { address = SockAddrUnix.create(); address.setFamily(ProtocolFamily.PF_UNIX); address.setPath(path); }
static UnixSocketAddress bind(int fd, UnixSocketAddress local) throws IOException { SockAddrUnix sa; if (null == local) { // Support autobind sa = SockAddrUnix.create(); sa.setFamily(ProtocolFamily.PF_UNIX); if (currentOS == OS.LINUX) { // On Linux, we simply set an empty path sa.setPath(""); } else { // Emulate something similar (bind to some random unique address), // but use regular namespace File f = Files.createTempFile("jnr-unixsocket-tmp", ".sock").toFile(); f.deleteOnExit(); f.delete(); sa.setPath(f.getPath()); } } else { sa = local.getStruct(); } if (Native.bind(fd, sa, sa.length()) < 0) { throw new IOException(Native.getLastErrorString()); } return getsockname(fd); }