From 84791fa3063fa402773887627a807e6072dd2172 Mon Sep 17 00:00:00 2001 From: Spencer Park Date: Fri, 19 Jan 2024 20:32:07 -0800 Subject: [PATCH 1/8] Implement ipc --- src/main/java/zmq/SocketBase.java | 19 +- .../zmq/io/net/AbstractSocketConnecter.java | 329 ++++++++++++++++++ .../zmq/io/net/AbstractSocketListener.java | 181 ++++++++++ src/main/java/zmq/io/net/Address.java | 14 +- src/main/java/zmq/io/net/ProtocolFamily.java | 9 - .../zmq/io/net/StandardProtocolFamily.java | 10 - src/main/java/zmq/io/net/ipc/IpcAddress.java | 100 ++---- .../java/zmq/io/net/ipc/IpcConnecter.java | 22 +- src/main/java/zmq/io/net/ipc/IpcListener.java | 74 +++- .../zmq/io/net/ipc/IpcViaLoopbackAddress.java | 105 ++++++ .../io/net/ipc/IpcViaLoopbackConnector.java | 16 + .../io/net/ipc/IpcViaLoopbackListener.java | 40 +++ src/main/java/zmq/io/net/tcp/TcpAddress.java | 27 +- .../java/zmq/io/net/tcp/TcpConnecter.java | 329 +----------------- src/main/java/zmq/io/net/tcp/TcpListener.java | 236 ++++--------- src/test/java/zmq/TermEndpointIpcTest.java | 11 +- 16 files changed, 890 insertions(+), 632 deletions(-) create mode 100644 src/main/java/zmq/io/net/AbstractSocketConnecter.java create mode 100644 src/main/java/zmq/io/net/AbstractSocketListener.java delete mode 100644 src/main/java/zmq/io/net/ProtocolFamily.java delete mode 100644 src/main/java/zmq/io/net/StandardProtocolFamily.java create mode 100644 src/main/java/zmq/io/net/ipc/IpcViaLoopbackAddress.java create mode 100644 src/main/java/zmq/io/net/ipc/IpcViaLoopbackConnector.java create mode 100644 src/main/java/zmq/io/net/ipc/IpcViaLoopbackListener.java diff --git a/src/main/java/zmq/SocketBase.java b/src/main/java/zmq/SocketBase.java index 6365ac986..8461e5eee 100644 --- a/src/main/java/zmq/SocketBase.java +++ b/src/main/java/zmq/SocketBase.java @@ -17,6 +17,7 @@ import zmq.io.net.Address.IZAddress; import zmq.io.net.Listener; import zmq.io.net.NetProtocol; +import zmq.io.net.tcp.TcpAddress; import zmq.pipe.Pipe; import zmq.poll.IPollEvents; import zmq.poll.Poller; @@ -29,7 +30,7 @@ public abstract class SocketBase extends Own implements IPollEvents, Pipe.IPipeE { private static class EndpointPipe { - private final Own endpoint; + private final Own endpoint; private final Pipe pipe; public EndpointPipe(Own endpoint, Pipe pipe) @@ -97,7 +98,7 @@ public void close() private final Set pipes; // Reaper's poller and handle of this socket within it. - private Poller poller; + private Poller poller; private Poller.Handle handle; // Timestamp of when commands were processed the last time. @@ -536,13 +537,13 @@ else if (options.recvHwm != 0 && peer.options.sendHwm != 0) { } // Create a bi-directional pipe to connect the peers. - ZObject[] parents = {this, peer.socket == null ? this : peer.socket}; + ZObject[] parents = { this, peer.socket == null ? this : peer.socket }; boolean conflate = options.conflate && (options.type == ZMQ.ZMQ_DEALER || options.type == ZMQ.ZMQ_PULL || options.type == ZMQ.ZMQ_PUSH || options.type == ZMQ.ZMQ_PUB || options.type == ZMQ.ZMQ_SUB); - int[] hwms = {conflate ? -1 : sndhwm, conflate ? -1 : rcvhwm}; - boolean[] conflates = {conflate, conflate}; + int[] hwms = { conflate ? -1 : sndhwm, conflate ? -1 : rcvhwm }; + boolean[] conflates = { conflate, conflate }; Pipe[] pipes = Pipe.pair(parents, hwms, conflates); // Attach local end of the pipe to this socket object. @@ -658,12 +659,12 @@ else if (options.recvHwm != 0 && peer.options.sendHwm != 0) { if (options.immediate || subscribe2all) { // Create a bi-directional pipe. - ZObject[] parents = {this, session}; + ZObject[] parents = { this, session }; boolean conflate = options.conflate && (options.type == ZMQ.ZMQ_DEALER || options.type == ZMQ.ZMQ_PULL || options.type == ZMQ.ZMQ_PUSH || options.type == ZMQ.ZMQ_PUB || options.type == ZMQ.ZMQ_SUB); - int[] hwms = {conflate ? -1 : options.sendHwm, conflate ? -1 : options.recvHwm}; - boolean[] conflates = {conflate, conflate}; + int[] hwms = { conflate ? -1 : options.sendHwm, conflate ? -1 : options.recvHwm }; + boolean[] conflates = { conflate, conflate }; Pipe[] pipes = Pipe.pair(parents, hwms, conflates); // Attach local end of the pipe to the socket object. @@ -758,7 +759,7 @@ public final boolean termEndpoint(String addr) endpoint = endpoints.hasValues(resolvedAddress); if (!endpoint) { // no luck, try with local resolution - InetSocketAddress socketAddress = address.resolve(uri.getAddress(), options.ipv6, true); + InetSocketAddress socketAddress = TcpAddress.resolve(uri.getAddress(), options.ipv6, true); resolvedAddress = socketAddress.toString(); } } diff --git a/src/main/java/zmq/io/net/AbstractSocketConnecter.java b/src/main/java/zmq/io/net/AbstractSocketConnecter.java new file mode 100644 index 000000000..9a97da5c6 --- /dev/null +++ b/src/main/java/zmq/io/net/AbstractSocketConnecter.java @@ -0,0 +1,329 @@ +package zmq.io.net; + +import java.io.IOException; +import java.net.SocketAddress; +import java.nio.channels.SocketChannel; + +import zmq.Options; +import zmq.Own; +import zmq.SocketBase; +import zmq.ZError; +import zmq.io.IOObject; +import zmq.io.IOThread; +import zmq.io.SessionBase; +import zmq.io.StreamEngine; +import zmq.poll.IPollEvents; +import zmq.poll.Poller; +import zmq.util.Utils; + +// If 'delay' is true connecter first waits for a while, then starts +// connection process. +public abstract class AbstractSocketConnecter extends Own implements IPollEvents +{ + // ID of the timer used to delay the reconnection. + protected static final int RECONNECT_TIMER_ID = 1; + + protected final IOObject ioObject; + + // Address to connect to. Owned by session_base_t. + private final Address addr; + + // Underlying socket. + private SocketChannel fd; + private Poller.Handle handle; + + // If true, connecter is waiting a while before trying to connect. + protected final boolean delayedStart; + + // True if a timer has been started. + private boolean timerStarted; + + // Reference to the session we belong to. + private final SessionBase session; + + // Current reconnect ivl, updated for backoff strategy + private int currentReconnectIvl; + + // Socket + private final SocketBase socket; + + public AbstractSocketConnecter(IOThread ioThread, SessionBase session, final Options options, final Address addr, + boolean delayedStart) + { + super(ioThread, options); + ioObject = new IOObject(ioThread, this); + this.addr = addr; + fd = null; + this.delayedStart = delayedStart; + timerStarted = false; + this.session = session; + currentReconnectIvl = this.options.reconnectIvl; + + assert (this.addr != null); + + socket = session.getSocket(); + } + + @Override + protected void destroy() + { + assert (!timerStarted); + assert (handle == null); + assert (fd == null); + ioObject.unplug(); + } + + @Override + protected void processPlug() + { + ioObject.plug(); + if (delayedStart) { + addReconnectTimer(); + } + else { + startConnecting(); + } + } + + @Override + protected void processTerm(int linger) + { + if (timerStarted) { + ioObject.cancelTimer(RECONNECT_TIMER_ID); + timerStarted = false; + } + + if (handle != null) { + ioObject.removeHandle(handle); + handle = null; + } + + if (fd != null) { + close(); + } + + super.processTerm(linger); + } + + @Override + public void connectEvent() + { + ioObject.removeHandle(handle); + handle = null; + + SocketChannel channel = connect(); + + if (channel == null) { + // Handle the error condition by attempt to reconnect. + close(); + addReconnectTimer(); + return; + } + + try { + this.tuneConnectedChannel(channel); + } + catch (IOException e) { + throw new ZError.IOException(e); + } + + // remember our fd for ZMQ_SRCFD in messages + // socket.setFd(channel); + + // Create the engine object for this connection. + StreamEngine engine; + try { + engine = new StreamEngine(channel, options, addr.toString()); + } + catch (ZError.InstantiationException e) { + // TODO V4 socket.eventConnectDelayed(addr.toString(), -1); + return; + } + + this.fd = null; + + // Attach the engine to the corresponding session object. + sendAttach(session, engine); + + // Shut the connecter down. + terminate(); + + socket.eventConnected(addr.toString(), channel); + } + + @Override + public void timerEvent(int id) + { + assert (id == RECONNECT_TIMER_ID); + + timerStarted = false; + startConnecting(); + } + + // Internal function to start the actual connection establishment. + private void startConnecting() + { + // Open the connecting socket. + try { + boolean rc = open(); + + // Connect may succeed in synchronous manner. + if (rc) { + handle = ioObject.addFd(fd); + connectEvent(); + } + // Connection establishment may be delayed. Poll for its completion. + else { + handle = ioObject.addFd(fd); + ioObject.setPollConnect(handle); + socket.eventConnectDelayed(addr.toString(), -1); + } + } + catch (RuntimeException | IOException e) { + // Handle any other error condition by eventual reconnect. + if (fd != null) { + close(); + } + addReconnectTimer(); + } + } + + // Internal function to add a reconnect timer + private void addReconnectTimer() + { + int rcIvl = getNewReconnectIvl(); + ioObject.addTimer(rcIvl, RECONNECT_TIMER_ID); + + // resolve address again to take into account other addresses + // besides the failing one (e.g. multiple dns entries). + try { + addr.resolve(options.ipv6); + } + catch (Exception ignored) { + // This will fail if the network goes away and the + // address cannot be resolved for some reason. Try + // not to fail as the event loop will quit + } + + socket.eventConnectRetried(addr.toString(), rcIvl); + timerStarted = true; + } + + // Internal function to return a reconnect backoff delay. + // Will modify the currentReconnectIvl used for next call + // Returns the currently used interval + private int getNewReconnectIvl() + { + // The new interval is the current interval + random value. + int interval = currentReconnectIvl + (Utils.randomInt() % options.reconnectIvl); + + // Only change the current reconnect interval if the maximum reconnect + // interval was set and if it's larger than the reconnect interval. + if (options.reconnectIvlMax > 0 && options.reconnectIvlMax > options.reconnectIvl) { + // Calculate the next interval + currentReconnectIvl = Math.min(currentReconnectIvl * 2, options.reconnectIvlMax); + } + return interval; + } + + // Open connecting socket. + // Returns true if connect was successful immediately. + // Returns false if async connect was launched. + private boolean open() throws IOException + { + assert (fd == null); + + // Resolve the address + if (addr == null) { + throw new IOException("Null address"); + } + + addr.resolve(options.ipv6); + + Address.IZAddress resolved = addr.resolved(); + if (resolved == null) { + throw new IOException("Address not resolved"); + } + + SocketAddress sa = resolved.address(); + if (sa == null) { + throw new IOException("Socket address not resolved"); + } + + this.fd = this.openClient(resolved); + + // TODO V4 Set a source address for conversations + // Connect to the remote peer. + boolean rc; + try { + rc = fd.connect(sa); + if (rc) { + // Connect was successful immediately. + } + else { + // Translate error codes indicating asynchronous connect has been + // launched to a uniform EINPROGRESS. + errno.set(ZError.EINPROGRESS); + } + } + catch (IllegalArgumentException e) { + // this will happen if sa is bad. Address validation is not documented but + // I've found that IAE is thrown in openjdk as well as on android. + throw new IOException(e.getMessage(), e); + } + + return rc; + + } + + protected abstract SocketChannel openClient(Address.IZAddress address) throws IOException; + + protected abstract void tuneConnectedChannel(SocketChannel channel) throws IOException; + + // Get the file descriptor of newly created connection. Returns + // null if the connection was unsuccessful. + private SocketChannel connect() + { + try { + // Async connect has finished. Check whether an error occurred + boolean finished = fd.finishConnect(); + assert (finished); + return fd; + } + catch (IOException e) { + return null; + } + } + + // Close the connecting socket. + protected void close() + { + assert (fd != null); + try { + fd.close(); + socket.eventClosed(addr.toString(), fd); + } + catch (IOException e) { + socket.eventCloseFailed(addr.toString(), ZError.exccode(e)); + } + fd = null; + } + + @Override + public void inEvent() + { + // connected but attaching to stream engine is not completed. do nothing + } + + @Override + public void outEvent() + { + // connected but attaching to stream engine is not completed. do nothing + } + + @Override + public String toString() + { + return getClass().getSimpleName() + "[" + options.socketId + "]"; + } +} diff --git a/src/main/java/zmq/io/net/AbstractSocketListener.java b/src/main/java/zmq/io/net/AbstractSocketListener.java new file mode 100644 index 000000000..f288d2d6c --- /dev/null +++ b/src/main/java/zmq/io/net/AbstractSocketListener.java @@ -0,0 +1,181 @@ +package zmq.io.net; + +import java.io.IOException; +import java.nio.channels.ServerSocketChannel; +import java.nio.channels.SocketChannel; + +import zmq.Options; +import zmq.SocketBase; +import zmq.ZError; +import zmq.io.IOObject; +import zmq.io.IOThread; +import zmq.io.SessionBase; +import zmq.io.StreamEngine; +import zmq.poll.Poller; +import zmq.socket.Sockets; + +public abstract class AbstractSocketListener extends Listener +{ + // Address to listen on. + private A address; + + // Underlying socket. + private ServerSocketChannel fd; + private Poller.Handle handle; + + // String representation of endpoint to bind to + private String endpoint; + + private final IOObject ioObject; + + public AbstractSocketListener(IOThread ioThread, SocketBase socket, final Options options) + { + super(ioThread, socket, options); + + ioObject = new IOObject(ioThread, this); + fd = null; + } + + protected ServerSocketChannel getFd() + { + return this.fd; + } + + protected A getZAddress() + { + return this.address; + } + + @Override + public void destroy() + { + assert (fd == null); + assert (handle == null); + ioObject.unplug(); + } + + @Override + protected void processPlug() + { + // Start polling for incoming connections. + ioObject.plug(); + handle = ioObject.addFd(fd); + ioObject.setPollAccept(handle); + } + + @Override + protected void processTerm(int linger) + { + ioObject.removeHandle(handle); + handle = null; + close(); + super.processTerm(linger); + } + + @Override + public void acceptEvent() + { + SocketChannel channel; + + try { + channel = accept(fd); + + // If connection was reset by the peer in the meantime, just ignore it. + if (channel == null) { + socket.eventAcceptFailed(endpoint, ZError.EADDRNOTAVAIL); + return; + } + this.tuneAcceptedChannel(channel); + } + catch (IOException e) { + // If connection was reset by the peer in the meantime, just ignore it. + // TODO: Handle specific errors like ENFILE/EMFILE etc. + socket.eventAcceptFailed(endpoint, ZError.exccode(e)); + return; + } + + // remember our fd for ZMQ_SRCFD in messages + // socket.setFd(channel); + + // Create the engine object for this connection. + StreamEngine engine; + try { + engine = new StreamEngine(channel, options, endpoint); + } + catch (ZError.InstantiationException e) { + socket.eventAcceptFailed(endpoint, ZError.EINVAL); + return; + } + + // Choose I/O thread to run connecter in. Given that we are already + // running in an I/O thread, there must be at least one available. + IOThread ioThread = chooseIoThread(options.affinity); + assert (ioThread != null); + + // Create and launch a session object. + SessionBase session = Sockets.createSession(ioThread, false, socket, options, null); + assert (session != null); + + session.incSeqnum(); + launchChild(session); + sendAttach(session, engine, false); + socket.eventAccepted(endpoint, channel); + } + + // Close the listening socket. + private void close() + { + assert (fd != null); + + try { + this.closeServerChannel(fd); + socket.eventClosed(endpoint, fd); + } + catch (IOException e) { + socket.eventCloseFailed(endpoint, ZError.exccode(e)); + } + fd = null; + } + + protected abstract void closeServerChannel(ServerSocketChannel fd) throws IOException; + + protected boolean setZAddress(A address) + { + this.address = address; + endpoint = address.toString(); + + // Create a listening socket. + try { + fd = this.openServer(address); + this.bindServer(fd, address); + + // find the address in case of wildcard + endpoint = getAddress(); + } + catch (IOException e) { + close(); + errno.set(ZError.EADDRINUSE); + return false; + } + socket.eventListening(endpoint, fd); + return true; + } + + protected abstract ServerSocketChannel openServer(A address) throws IOException; + + protected abstract void bindServer(ServerSocketChannel fd, A address) throws IOException; + + // Accept the new connection. Returns the file descriptor of the + // newly created connection. The function may throw IOException + // if the connection was dropped while waiting in the listen backlog + // or was denied because of accept filters. + protected abstract SocketChannel accept(ServerSocketChannel fd) throws IOException; + + protected abstract void tuneAcceptedChannel(SocketChannel channel) throws IOException; + + @Override + public String toString() + { + return getClass().getSimpleName() + "[" + options.socketId + "]"; + } +} diff --git a/src/main/java/zmq/io/net/Address.java b/src/main/java/zmq/io/net/Address.java index c6eb0e3f1..94775b0ef 100644 --- a/src/main/java/zmq/io/net/Address.java +++ b/src/main/java/zmq/io/net/Address.java @@ -1,7 +1,9 @@ package zmq.io.net; import java.net.InetSocketAddress; +import java.net.ProtocolFamily; import java.net.SocketAddress; +import java.net.UnixDomainSocketAddress; public class Address { @@ -11,11 +13,11 @@ public interface IZAddress String toString(int port); - InetSocketAddress resolve(String name, boolean ipv6, boolean local); + // TODO this is really only used internally, the one external use is specific to re-trying local resolution + // for tcp. Doesn't really belong in this interface. + // SocketAddress resolve(String name, boolean ipv6, boolean local); SocketAddress address(); - - SocketAddress sourceAddress(); } private final NetProtocol protocol; @@ -59,6 +61,12 @@ public Address(SocketAddress socketAddress) protocol = NetProtocol.tcp; resolved = null; } + else if (socketAddress instanceof UnixDomainSocketAddress) { + UnixDomainSocketAddress sockAddr = (UnixDomainSocketAddress) socketAddress; + this.address = sockAddr.getPath().toString(); + protocol = NetProtocol.ipc; + resolved = null; + } else { throw new IllegalArgumentException("Not a IP socket address"); } diff --git a/src/main/java/zmq/io/net/ProtocolFamily.java b/src/main/java/zmq/io/net/ProtocolFamily.java deleted file mode 100644 index be3bd64f4..000000000 --- a/src/main/java/zmq/io/net/ProtocolFamily.java +++ /dev/null @@ -1,9 +0,0 @@ -package zmq.io.net; - -/** - * Replacement of ProtocolFamily from SDK so it can be used in Android environments. - */ -public interface ProtocolFamily -{ - String name(); -} diff --git a/src/main/java/zmq/io/net/StandardProtocolFamily.java b/src/main/java/zmq/io/net/StandardProtocolFamily.java deleted file mode 100644 index c6eee27fd..000000000 --- a/src/main/java/zmq/io/net/StandardProtocolFamily.java +++ /dev/null @@ -1,10 +0,0 @@ -package zmq.io.net; - -/** - * Replacement of StandardProtocolFamily from SDK so it can be used in Android environments. - */ -public enum StandardProtocolFamily implements ProtocolFamily -{ - INET, - INET6 -} diff --git a/src/main/java/zmq/io/net/ipc/IpcAddress.java b/src/main/java/zmq/io/net/ipc/IpcAddress.java index d7b5e1e6d..85422085e 100644 --- a/src/main/java/zmq/io/net/ipc/IpcAddress.java +++ b/src/main/java/zmq/io/net/ipc/IpcAddress.java @@ -1,23 +1,22 @@ package zmq.io.net.ipc; -import java.net.Inet4Address; -import java.net.Inet6Address; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.NetworkInterface; +import java.io.IOException; +import java.net.ProtocolFamily; import java.net.SocketAddress; -import java.net.SocketException; -import java.util.Enumeration; +import java.net.StandardProtocolFamily; +import java.net.UnixDomainSocketAddress; +import java.nio.file.Files; +import java.nio.file.Path; -import zmq.ZMQ; +import org.zeromq.ZMQException; + +import zmq.ZError; import zmq.io.net.Address; -import zmq.io.net.ProtocolFamily; -import zmq.io.net.StandardProtocolFamily; import zmq.io.net.tcp.TcpAddress; -import zmq.util.Utils; public class IpcAddress implements Address.IZAddress { + // TODO unused? public static class IpcAddressMask extends TcpAddress { public IpcAddressMask(String addr, boolean ipv6) @@ -31,65 +30,53 @@ public boolean matchAddress(SocketAddress addr) } } - private String name; - private final InetSocketAddress address; - private final SocketAddress sourceAddress; + private String name; + private final UnixDomainSocketAddress address; public IpcAddress(String addr) { - String[] strings = addr.split(";"); - - address = resolve(strings[0], ZMQ.PREFER_IPV6, true); - if (strings.length == 2 && !"".equals(strings[1])) { - sourceAddress = resolve(strings[1], ZMQ.PREFER_IPV6, true); - } - else { - sourceAddress = null; - } + // TODO inline? + this.address = this.resolve(addr); } @Override public String toString() { + // TODO possible? if (name == null) { return ""; } - return "ipc://" + name; + return "ipc://" + this.address.toString(); } @Override public String toString(int port) { - if ("*".equals(name)) { - String suffix = Utils.unhash(port - 10000); - return "ipc://" + suffix; - } + // TODO why is port in the interface? return toString(); } - @Override - public InetSocketAddress resolve(String name, boolean ipv6, boolean loopback) + private UnixDomainSocketAddress resolve(String name) { this.name = name; - int hash = name.hashCode(); - if ("*".equals(name)) { - hash = 0; - } - else { - if (hash < 0) { - hash = -hash; - } - hash = hash % 55536; - hash += 10000; + if (!"*".equals(name)) { + return UnixDomainSocketAddress.of(name); } - return new InetSocketAddress(findAddress(ipv6, loopback), hash); + try { + Path temp = Files.createTempFile("zmq-", ".sock"); + Files.delete(temp); + return UnixDomainSocketAddress.of(temp); + } + catch (IOException e) { + throw new ZMQException(e.getMessage(), ZError.EADDRNOTAVAIL, e); + } } @Override - public SocketAddress address() + public UnixDomainSocketAddress address() { return address; } @@ -97,33 +84,6 @@ public SocketAddress address() @Override public ProtocolFamily family() { - return StandardProtocolFamily.INET; - } - - @Override - public SocketAddress sourceAddress() - { - return sourceAddress; - } - - private InetAddress findAddress(boolean ipv6, boolean loopback) - { - Class addressClass = ipv6 ? Inet6Address.class : Inet4Address.class; - try { - for (Enumeration interfaces = NetworkInterface - .getNetworkInterfaces(); interfaces.hasMoreElements(); ) { - NetworkInterface net = interfaces.nextElement(); - for (Enumeration addresses = net.getInetAddresses(); addresses.hasMoreElements(); ) { - InetAddress inetAddress = addresses.nextElement(); - if (inetAddress.isLoopbackAddress() == loopback && addressClass.isInstance(inetAddress)) { - return inetAddress; - } - } - } - } - catch (SocketException e) { - throw new IllegalArgumentException(e); - } - throw new IllegalArgumentException("no address found " + (ipv6 ? "IPV6" : "IPV4") + (loopback ? "local" : "")); + return StandardProtocolFamily.UNIX; } } diff --git a/src/main/java/zmq/io/net/ipc/IpcConnecter.java b/src/main/java/zmq/io/net/ipc/IpcConnecter.java index 717240314..0704d31b5 100644 --- a/src/main/java/zmq/io/net/ipc/IpcConnecter.java +++ b/src/main/java/zmq/io/net/ipc/IpcConnecter.java @@ -1,15 +1,33 @@ package zmq.io.net.ipc; +import java.io.IOException; +import java.net.StandardProtocolFamily; +import java.nio.channels.SocketChannel; + import zmq.Options; import zmq.io.IOThread; import zmq.io.SessionBase; +import zmq.io.net.AbstractSocketConnecter; import zmq.io.net.Address; -import zmq.io.net.tcp.TcpConnecter; -public class IpcConnecter extends TcpConnecter +public class IpcConnecter extends AbstractSocketConnecter { public IpcConnecter(IOThread ioThread, SessionBase session, final Options options, final Address addr, boolean wait) { super(ioThread, session, options, addr, wait); } + + @Override + protected SocketChannel openClient(Address.IZAddress address) throws IOException + { + SocketChannel fd = SocketChannel.open(StandardProtocolFamily.UNIX); + fd.configureBlocking(false); + return fd; + } + + @Override + protected void tuneConnectedChannel(SocketChannel channel) throws IOException + { + + } } diff --git a/src/main/java/zmq/io/net/ipc/IpcListener.java b/src/main/java/zmq/io/net/ipc/IpcListener.java index 450e18f2e..5dd9edef8 100644 --- a/src/main/java/zmq/io/net/ipc/IpcListener.java +++ b/src/main/java/zmq/io/net/ipc/IpcListener.java @@ -1,40 +1,88 @@ package zmq.io.net.ipc; -import java.net.InetSocketAddress; +import java.io.IOException; +import java.net.UnixDomainSocketAddress; +import java.nio.channels.ServerSocketChannel; +import java.nio.channels.SocketChannel; +import java.nio.file.Files; +import java.nio.file.Path; import zmq.Options; import zmq.SocketBase; import zmq.io.IOThread; -import zmq.io.net.tcp.TcpListener; +import zmq.io.net.AbstractSocketListener; -// fake Unix domain socket -public class IpcListener extends TcpListener +public class IpcListener extends AbstractSocketListener { - private IpcAddress address; + // bind will create this socket file but close will not remove it, so we need to do that ourselves on close. + private Path boundSocketPath; public IpcListener(IOThread ioThread, SocketBase socket, final Options options) { super(ioThread, socket, options); - } // Get the bound address for use with wildcards @Override public String getAddress() { - if (((InetSocketAddress) address.address()).getPort() == 0) { - return address(address); - } - return address.toString(); + // TODO + return super.getZAddress().toString(-1); } // Set address to listen on. @Override public boolean setAddress(String addr) { - address = new IpcAddress(addr); + return super.setZAddress(new IpcAddress(addr)); + } + + @Override + protected ServerSocketChannel openServer(IpcAddress address) throws IOException + { + if (options.selectorChooser == null) { + return ServerSocketChannel.open(address.family()); + } + else { + return options.selectorChooser.choose(address, options).openServerSocketChannel(address.family()); + } + } + + @Override + protected void bindServer(ServerSocketChannel fd, IpcAddress address) throws IOException + { + fd.configureBlocking(false); + + UnixDomainSocketAddress socketAddress = address.address(); + fd.bind(socketAddress, options.backlog); - InetSocketAddress sock = (InetSocketAddress) address.address(); - return super.setAddress(sock); + assert (this.boundSocketPath == null); + this.boundSocketPath = socketAddress.getPath(); + } + + @Override + protected SocketChannel accept(ServerSocketChannel fd) throws IOException + { + return fd.accept(); + } + + @Override + protected void tuneAcceptedChannel(SocketChannel channel) throws IOException + { + // no-op + } + + @Override + protected void closeServerChannel(ServerSocketChannel fd) throws IOException + { + try { + fd.close(); + } + finally { + assert (this.boundSocketPath != null); + Path socketPath = this.boundSocketPath; + this.boundSocketPath = null; + Files.deleteIfExists(socketPath); + } } } diff --git a/src/main/java/zmq/io/net/ipc/IpcViaLoopbackAddress.java b/src/main/java/zmq/io/net/ipc/IpcViaLoopbackAddress.java new file mode 100644 index 000000000..a7e2836af --- /dev/null +++ b/src/main/java/zmq/io/net/ipc/IpcViaLoopbackAddress.java @@ -0,0 +1,105 @@ +package zmq.io.net.ipc; + +import java.net.Inet4Address; +import java.net.Inet6Address; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.NetworkInterface; +import java.net.ProtocolFamily; +import java.net.SocketAddress; +import java.net.SocketException; +import java.net.StandardProtocolFamily; +import java.util.Enumeration; + +import zmq.ZMQ; +import zmq.io.net.Address; +import zmq.util.Utils; + +public class IpcViaLoopbackAddress implements Address.IZAddress +{ + + private String name; + private final InetSocketAddress address; + + public IpcViaLoopbackAddress(String addr) + { + String[] strings = addr.split(";"); + + address = resolve(strings[0]); + if (strings.length == 2 && !"".equals(strings[1])) { + resolve(strings[1]); + } + } + + @Override + public String toString() + { + if (name == null) { + return ""; + } + + return "ipc://" + name; + } + + @Override + public String toString(int port) + { + if ("*".equals(name)) { + String suffix = Utils.unhash(port - 10000); + return "ipc://" + suffix; + } + return toString(); + } + + private InetSocketAddress resolve(String name) + { + this.name = name; + + int hash = name.hashCode(); + if ("*".equals(name)) { + hash = 0; + } + else { + if (hash < 0) { + hash = -hash; + } + hash = hash % 55536; + hash += 10000; + } + + return new InetSocketAddress(findAddress(), hash); + } + + @Override + public SocketAddress address() + { + return address; + } + + @Override + public ProtocolFamily family() + { + return StandardProtocolFamily.INET; + } + + private InetAddress findAddress() + { + Class addressClass = ZMQ.PREFER_IPV6 ? Inet6Address.class : Inet4Address.class; + try { + for (Enumeration interfaces = NetworkInterface.getNetworkInterfaces(); interfaces + .hasMoreElements();) { + NetworkInterface net = interfaces.nextElement(); + for (Enumeration addresses = net.getInetAddresses(); addresses.hasMoreElements();) { + InetAddress inetAddress = addresses.nextElement(); + if (inetAddress.isLoopbackAddress() && addressClass.isInstance(inetAddress)) { + return inetAddress; + } + } + } + } + catch (SocketException e) { + throw new IllegalArgumentException(e); + } + throw new IllegalArgumentException("no address found " + (ZMQ.PREFER_IPV6 ? "IPV6" : "IPV4") + "local"); + } +} \ No newline at end of file diff --git a/src/main/java/zmq/io/net/ipc/IpcViaLoopbackConnector.java b/src/main/java/zmq/io/net/ipc/IpcViaLoopbackConnector.java new file mode 100644 index 000000000..43ef6a45b --- /dev/null +++ b/src/main/java/zmq/io/net/ipc/IpcViaLoopbackConnector.java @@ -0,0 +1,16 @@ +package zmq.io.net.ipc; + +import zmq.Options; +import zmq.io.IOThread; +import zmq.io.SessionBase; +import zmq.io.net.Address; +import zmq.io.net.tcp.TcpConnecter; + +public class IpcViaLoopbackConnector extends TcpConnecter +{ + public IpcViaLoopbackConnector(IOThread ioThread, SessionBase session, final Options options, final Address addr, + boolean wait) + { + super(ioThread, session, options, addr, wait); + } +} diff --git a/src/main/java/zmq/io/net/ipc/IpcViaLoopbackListener.java b/src/main/java/zmq/io/net/ipc/IpcViaLoopbackListener.java new file mode 100644 index 000000000..0092b6033 --- /dev/null +++ b/src/main/java/zmq/io/net/ipc/IpcViaLoopbackListener.java @@ -0,0 +1,40 @@ +package zmq.io.net.ipc; + +import java.net.InetSocketAddress; + +import zmq.Options; +import zmq.SocketBase; +import zmq.io.IOThread; +import zmq.io.net.Address; +import zmq.io.net.tcp.TcpListener; + +// fake Unix domain socket +public class IpcViaLoopbackListener extends TcpListener +{ + public IpcViaLoopbackListener(IOThread ioThread, SocketBase socket, final Options options) + { + super(ioThread, socket, options); + + } + + // Get the bound address for use with wildcards + @Override + public String getAddress() + { + Address.IZAddress address = super.getZAddress(); + if (((InetSocketAddress) address.address()).getPort() == 0) { + return address(address); + } + return address.toString(); + } + + // Set address to listen on. + @Override + public boolean setAddress(String addr) + { + var address = new IpcViaLoopbackAddress(addr); + + InetSocketAddress sock = (InetSocketAddress) address.address(); + return super.setAddress(sock); + } +} \ No newline at end of file diff --git a/src/main/java/zmq/io/net/tcp/TcpAddress.java b/src/main/java/zmq/io/net/tcp/TcpAddress.java index 6f821e5f4..59a1dcedc 100644 --- a/src/main/java/zmq/io/net/tcp/TcpAddress.java +++ b/src/main/java/zmq/io/net/tcp/TcpAddress.java @@ -4,15 +4,15 @@ import java.net.Inet6Address; import java.net.InetAddress; import java.net.InetSocketAddress; +import java.net.ProtocolFamily; import java.net.SocketAddress; +import java.net.StandardProtocolFamily; import java.net.UnknownHostException; import org.zeromq.ZMQException; import zmq.ZError; import zmq.io.net.Address; -import zmq.io.net.ProtocolFamily; -import zmq.io.net.StandardProtocolFamily; public class TcpAddress implements Address.IZAddress { @@ -30,7 +30,6 @@ public boolean matchAddress(SocketAddress addr) } private final InetSocketAddress address; - private final SocketAddress sourceAddress; public TcpAddress(String addr, boolean ipv6) { @@ -38,17 +37,13 @@ public TcpAddress(String addr, boolean ipv6) address = resolve(strings[0], ipv6, false); if (strings.length == 2 && !"".equals(strings[1])) { - sourceAddress = resolve(strings[1], ipv6, false); - } - else { - sourceAddress = null; + resolve(strings[1], ipv6, false); } } protected TcpAddress(InetSocketAddress address) { this.address = address; - sourceAddress = null; } @Override @@ -87,15 +82,7 @@ public String toString(int port) } } - /** - * @param name - * @param ipv6 - * @param local ignored - * @return the resolved address - * @see zmq.io.net.Address.IZAddress#resolve(java.lang.String, boolean, boolean) - */ - @Override - public InetSocketAddress resolve(String name, boolean ipv6, boolean local) + public static InetSocketAddress resolve(String name, boolean ipv6, boolean local) { // Find the ':' at end that separates address from the port number. int delimiter = name.lastIndexOf(':'); @@ -173,10 +160,4 @@ public SocketAddress address() { return address; } - - @Override - public SocketAddress sourceAddress() - { - return sourceAddress; - } } diff --git a/src/main/java/zmq/io/net/tcp/TcpConnecter.java b/src/main/java/zmq/io/net/tcp/TcpConnecter.java index 3060f2702..dab560f43 100644 --- a/src/main/java/zmq/io/net/tcp/TcpConnecter.java +++ b/src/main/java/zmq/io/net/tcp/TcpConnecter.java @@ -1,276 +1,38 @@ package zmq.io.net.tcp; import java.io.IOException; -import java.net.SocketAddress; +import java.net.StandardProtocolFamily; import java.nio.channels.SocketChannel; import zmq.Options; -import zmq.Own; -import zmq.SocketBase; -import zmq.ZError; -import zmq.io.IOObject; import zmq.io.IOThread; import zmq.io.SessionBase; -import zmq.io.StreamEngine; +import zmq.io.net.AbstractSocketConnecter; import zmq.io.net.Address; -import zmq.io.net.StandardProtocolFamily; -import zmq.poll.IPollEvents; -import zmq.poll.Poller; -import zmq.util.Utils; -// If 'delay' is true connecter first waits for a while, then starts -// connection process. -public class TcpConnecter extends Own implements IPollEvents +public class TcpConnecter extends AbstractSocketConnecter { - // ID of the timer used to delay the reconnection. - protected static final int RECONNECT_TIMER_ID = 1; - - protected final IOObject ioObject; - - // Address to connect to. Owned by session_base_t. - private final Address addr; - - // Underlying socket. - private SocketChannel fd; - private Poller.Handle handle; - - // If true, connecter is waiting a while before trying to connect. - protected final boolean delayedStart; - - // True if a timer has been started. - private boolean timerStarted; - - // Reference to the session we belong to. - private final SessionBase session; - - // Current reconnect ivl, updated for backoff strategy - private int currentReconnectIvl; - - // Socket - private final SocketBase socket; - public TcpConnecter(IOThread ioThread, SessionBase session, final Options options, final Address addr, boolean delayedStart) { - super(ioThread, options); - ioObject = new IOObject(ioThread, this); - this.addr = addr; - fd = null; - this.delayedStart = delayedStart; - timerStarted = false; - this.session = session; - currentReconnectIvl = this.options.reconnectIvl; - - assert (this.addr != null); - // assert (NetProtocol.tcp.equals(this.addr.protocol())); // not always true, as ipc is emulated by tcp - - socket = session.getSocket(); - } - - @Override - protected void destroy() - { - assert (!timerStarted); - assert (handle == null); - assert (fd == null); - ioObject.unplug(); - } - - @Override - protected void processPlug() - { - ioObject.plug(); - if (delayedStart) { - addReconnectTimer(); - } - else { - startConnecting(); - } - } - - @Override - protected void processTerm(int linger) - { - if (timerStarted) { - ioObject.cancelTimer(RECONNECT_TIMER_ID); - timerStarted = false; - } - - if (handle != null) { - ioObject.removeHandle(handle); - handle = null; - } - - if (fd != null) { - close(); - } - - super.processTerm(linger); - } - - @Override - public void connectEvent() - { - ioObject.removeHandle(handle); - handle = null; - - SocketChannel channel = connect(); - - if (channel == null) { - // Handle the error condition by attempt to reconnect. - close(); - addReconnectTimer(); - return; - } - - try { - TcpUtils.tuneTcpSocket(channel); - TcpUtils.tuneTcpKeepalives( - channel, - options.tcpKeepAlive, - options.tcpKeepAliveCnt, - options.tcpKeepAliveIdle, - options.tcpKeepAliveIntvl); - } - catch (IOException e) { - throw new ZError.IOException(e); - } - - // remember our fd for ZMQ_SRCFD in messages - // socket.setFd(channel); - - // Create the engine object for this connection. - StreamEngine engine; - try { - engine = new StreamEngine(channel, options, addr.toString()); - } - catch (ZError.InstantiationException e) { - // TODO V4 socket.eventConnectDelayed(addr.toString(), -1); - return; - } - - this.fd = null; - - // Attach the engine to the corresponding session object. - sendAttach(session, engine); - - // Shut the connecter down. - terminate(); - - socket.eventConnected(addr.toString(), channel); + super(ioThread, session, options, addr, delayedStart); } @Override - public void timerEvent(int id) + protected SocketChannel openClient(Address.IZAddress address) throws IOException { - assert (id == RECONNECT_TIMER_ID); - - timerStarted = false; - startConnecting(); - } - - // Internal function to start the actual connection establishment. - private void startConnecting() - { - // Open the connecting socket. - try { - boolean rc = open(); - - // Connect may succeed in synchronous manner. - if (rc) { - handle = ioObject.addFd(fd); - connectEvent(); - } - // Connection establishment may be delayed. Poll for its completion. - else { - handle = ioObject.addFd(fd); - ioObject.setPollConnect(handle); - socket.eventConnectDelayed(addr.toString(), -1); - } - } - catch (RuntimeException | IOException e) { - // Handle any other error condition by eventual reconnect. - if (fd != null) { - close(); - } - addReconnectTimer(); - } - } - - // Internal function to add a reconnect timer - private void addReconnectTimer() - { - int rcIvl = getNewReconnectIvl(); - ioObject.addTimer(rcIvl, RECONNECT_TIMER_ID); - - // resolve address again to take into account other addresses - // besides the failing one (e.g. multiple dns entries). - try { - addr.resolve(options.ipv6); - } - catch (Exception ignored) { - // This will fail if the network goes away and the - // address cannot be resolved for some reason. Try - // not to fail as the event loop will quit - } - - socket.eventConnectRetried(addr.toString(), rcIvl); - timerStarted = true; - } - - // Internal function to return a reconnect backoff delay. - // Will modify the currentReconnectIvl used for next call - // Returns the currently used interval - private int getNewReconnectIvl() - { - // The new interval is the current interval + random value. - int interval = currentReconnectIvl + (Utils.randomInt() % options.reconnectIvl); - - // Only change the current reconnect interval if the maximum reconnect - // interval was set and if it's larger than the reconnect interval. - if (options.reconnectIvlMax > 0 && options.reconnectIvlMax > options.reconnectIvl) { - // Calculate the next interval - currentReconnectIvl = Math.min(currentReconnectIvl * 2, options.reconnectIvlMax); - } - return interval; - } - - // Open TCP connecting socket. - // Returns true if connect was successful immediately. - // Returns false if async connect was launched. - private boolean open() throws IOException - { - assert (fd == null); - - // Resolve the address - if (addr == null) { - throw new IOException("Null address"); - } - - addr.resolve(options.ipv6); - - Address.IZAddress resolved = addr.resolved(); - if (resolved == null) { - throw new IOException("Address not resolved"); - } - - SocketAddress sa = resolved.address(); - if (sa == null) { - throw new IOException("Socket address not resolved"); - } - - // Create the socket. + SocketChannel fd; if (options.selectorChooser == null) { fd = SocketChannel.open(); } else { - fd = options.selectorChooser.choose(resolved, options).openSocketChannel(); + fd = options.selectorChooser.choose(address, options).openSocketChannel(); } // On some systems, IPv4 mapping in IPv6 sockets is disabled by default. // Switch it on in such cases. // The method enableIpv4Mapping is empty. Still to be written - if (resolved.family() == StandardProtocolFamily.INET6) { + if (address.family() == StandardProtocolFamily.INET6) { TcpUtils.enableIpv4Mapping(fd); } @@ -289,75 +51,18 @@ private boolean open() throws IOException if (options.tos != 0) { TcpUtils.setIpTypeOfService(fd, options.tos); } - - // TODO V4 Set a source address for conversations - // Connect to the remote peer. - boolean rc; - try { - rc = fd.connect(sa); - if (rc) { - // Connect was successful immediately. - } - else { - // Translate error codes indicating asynchronous connect has been - // launched to a uniform EINPROGRESS. - errno.set(ZError.EINPROGRESS); - } - } - catch (IllegalArgumentException e) { - // this will happen if sa is bad. Address validation is not documented but - // I've found that IAE is thrown in openjdk as well as on android. - throw new IOException(e.getMessage(), e); - } - - return rc; - - } - - // Get the file descriptor of newly created connection. Returns - // null if the connection was unsuccessful. - private SocketChannel connect() - { - try { - // Async connect has finished. Check whether an error occurred - boolean finished = fd.finishConnect(); - assert (finished); - return fd; - } - catch (IOException e) { - return null; - } - } - - // Close the connecting socket. - protected void close() - { - assert (fd != null); - try { - fd.close(); - socket.eventClosed(addr.toString(), fd); - } - catch (IOException e) { - socket.eventCloseFailed(addr.toString(), ZError.exccode(e)); - } - fd = null; - } - - @Override - public void inEvent() - { - // connected but attaching to stream engine is not completed. do nothing - } - - @Override - public void outEvent() - { - // connected but attaching to stream engine is not completed. do nothing + return fd; } @Override - public String toString() + protected void tuneConnectedChannel(SocketChannel channel) throws IOException { - return getClass().getSimpleName() + "[" + options.socketId + "]"; + TcpUtils.tuneTcpSocket(channel); + TcpUtils.tuneTcpKeepalives( + channel, + options.tcpKeepAlive, + options.tcpKeepAliveCnt, + options.tcpKeepAliveIdle, + options.tcpKeepAliveIntvl); } } diff --git a/src/main/java/zmq/io/net/tcp/TcpListener.java b/src/main/java/zmq/io/net/tcp/TcpListener.java index 32cf462fa..c4cce9719 100644 --- a/src/main/java/zmq/io/net/tcp/TcpListener.java +++ b/src/main/java/zmq/io/net/tcp/TcpListener.java @@ -2,24 +2,18 @@ import java.io.IOException; import java.net.InetSocketAddress; +import java.net.StandardProtocolFamily; import java.nio.channels.ServerSocketChannel; import java.nio.channels.SocketChannel; import java.util.Locale; import zmq.Options; import zmq.SocketBase; -import zmq.ZError; -import zmq.io.IOObject; import zmq.io.IOThread; -import zmq.io.SessionBase; -import zmq.io.StreamEngine; -import zmq.io.net.Address.IZAddress; -import zmq.io.net.Listener; -import zmq.io.net.StandardProtocolFamily; -import zmq.poll.Poller; -import zmq.socket.Sockets; +import zmq.io.net.AbstractSocketListener; +import zmq.io.net.Address; -public class TcpListener extends Listener +public class TcpListener extends AbstractSocketListener { private static final boolean isWindows; static { @@ -27,208 +21,84 @@ public class TcpListener extends Listener isWindows = os.contains("win"); } - // Address to listen on. - private TcpAddress address; - - // Underlying socket. - private ServerSocketChannel fd; - private Poller.Handle handle; - - // String representation of endpoint to bind to - private String endpoint; - - private final IOObject ioObject; - public TcpListener(IOThread ioThread, SocketBase socket, final Options options) { super(ioThread, socket, options); - - ioObject = new IOObject(ioThread, this); - fd = null; - } - - @Override - public void destroy() - { - assert (fd == null); - assert (handle == null); - ioObject.unplug(); - } - - @Override - protected void processPlug() - { - // Start polling for incoming connections. - ioObject.plug(); - handle = ioObject.addFd(fd); - ioObject.setPollAccept(handle); - } - - @Override - protected void processTerm(int linger) - { - ioObject.removeHandle(handle); - handle = null; - close(); - super.processTerm(linger); } @Override - public void acceptEvent() - { - SocketChannel channel; - - try { - channel = accept(); - - // If connection was reset by the peer in the meantime, just ignore it. - if (channel == null) { - socket.eventAcceptFailed(endpoint, ZError.EADDRNOTAVAIL); - return; - } - TcpUtils.tuneTcpSocket(channel); - TcpUtils.tuneTcpKeepalives( - channel, - options.tcpKeepAlive, - options.tcpKeepAliveCnt, - options.tcpKeepAliveIdle, - options.tcpKeepAliveIntvl); - } - catch (IOException e) { - // If connection was reset by the peer in the meantime, just ignore it. - // TODO: Handle specific errors like ENFILE/EMFILE etc. - socket.eventAcceptFailed(endpoint, ZError.exccode(e)); - return; - } - - // remember our fd for ZMQ_SRCFD in messages - // socket.setFd(channel); - - // Create the engine object for this connection. - StreamEngine engine; - try { - engine = new StreamEngine(channel, options, endpoint); - } - catch (ZError.InstantiationException e) { - socket.eventAcceptFailed(endpoint, ZError.EINVAL); - return; - } - - // Choose I/O thread to run connecter in. Given that we are already - // running in an I/O thread, there must be at least one available. - IOThread ioThread = chooseIoThread(options.affinity); - assert (ioThread != null); - - // Create and launch a session object. - SessionBase session = Sockets.createSession(ioThread, false, socket, options, null); - assert (session != null); - - session.incSeqnum(); - launchChild(session); - sendAttach(session, engine, false); - socket.eventAccepted(endpoint, channel); - } - - // Close the listening socket. - private void close() - { - assert (fd != null); - - try { - fd.close(); - socket.eventClosed(endpoint, fd); - } - catch (IOException e) { - socket.eventCloseFailed(endpoint, ZError.exccode(e)); - } - fd = null; - } - public String getAddress() { - return address(address); + return address(super.getZAddress()); } - protected String address(IZAddress address) + protected String address(Address.IZAddress address) { - int port = fd.socket().getLocalPort(); + int port = super.getFd().socket().getLocalPort(); return address.toString(port); } - // Set address to listen on. + @Override public boolean setAddress(final String addr) { // Convert the textual address into address structure. - address = new TcpAddress(addr, options.ipv6); - return setAddress(); + return this.setZAddress(new TcpAddress(addr, options.ipv6)); } // Set address to listen on, used by IpcListener that already resolved the address. protected boolean setAddress(InetSocketAddress addr) { // Convert the textual address into address structure. - address = new TcpAddress(addr); - return setAddress(); + return this.setZAddress(new TcpAddress(addr)); } - private boolean setAddress() + @Override + protected ServerSocketChannel openServer(TcpAddress address) throws IOException { - endpoint = address.toString(); - - // Create a listening socket. - try { - if (options.selectorChooser == null) { - fd = ServerSocketChannel.open(); - } - else { - fd = options.selectorChooser.choose(address, options).openServerSocketChannel(); - } - - // On some systems, IPv4 mapping in IPv6 sockets is disabled by default. - // Switch it on in such cases. - // The method enableIpv4Mapping is empty. Still to be written - if (address.family() == StandardProtocolFamily.INET6) { - TcpUtils.enableIpv4Mapping(fd); - } - - TcpUtils.unblockSocket(fd); + if (options.selectorChooser == null) { + return ServerSocketChannel.open(); + } + else { + return options.selectorChooser.choose(address, options).openServerSocketChannel(); + } + } - // Set the socket buffer limits for the underlying socket. - if (options.sndbuf != 0) { - TcpUtils.setTcpSendBuffer(fd, options.sndbuf); - } - if (options.rcvbuf != 0) { - TcpUtils.setTcpReceiveBuffer(fd, options.rcvbuf); - } + @Override + protected void bindServer(ServerSocketChannel fd, TcpAddress address) throws IOException + { + // On some systems, IPv4 mapping in IPv6 sockets is disabled by default. + // Switch it on in such cases. + // The method enableIpv4Mapping is empty. Still to be written + if (address.family() == StandardProtocolFamily.INET6) { + TcpUtils.enableIpv4Mapping(fd); + } - if (!isWindows) { - TcpUtils.setReuseAddress(fd, true); - } + TcpUtils.unblockSocket(fd); - // Bind the socket to the network interface and port. - // NB: fd.socket().bind(...) for Android environments - fd.socket().bind(address.address(), options.backlog); - // find the address in case of wildcard - endpoint = getAddress(); + // Set the socket buffer limits for the underlying socket. + if (options.sndbuf != 0) { + TcpUtils.setTcpSendBuffer(fd, options.sndbuf); } - catch (IOException e) { - close(); - errno.set(ZError.EADDRINUSE); - return false; + if (options.rcvbuf != 0) { + TcpUtils.setTcpReceiveBuffer(fd, options.rcvbuf); } - socket.eventListening(endpoint, fd); - return true; + + if (!isWindows) { + TcpUtils.setReuseAddress(fd, true); + } + + // Bind the socket to the network interface and port. + // NB: fd.socket().bind(...) for Android environments + fd.socket().bind(address.address(), options.backlog); } - // Accept the new connection. Returns the file descriptor of the - // newly created connection. The function may throw IOException - // if the connection was dropped while waiting in the listen backlog - // or was denied because of accept filters. - private SocketChannel accept() throws IOException + @Override + protected SocketChannel accept(ServerSocketChannel fd) throws IOException { // The situation where connection cannot be accepted due to insufficient // resources is considered valid and treated by ignoring the connection. // Accept one connection and deal with different failure modes. + Address.IZAddress address = super.getZAddress(); assert (fd != null); SocketChannel sock = fd.accept(); @@ -270,8 +140,20 @@ private SocketChannel accept() throws IOException } @Override - public String toString() + protected void tuneAcceptedChannel(SocketChannel channel) throws IOException + { + TcpUtils.tuneTcpSocket(channel); + TcpUtils.tuneTcpKeepalives( + channel, + options.tcpKeepAlive, + options.tcpKeepAliveCnt, + options.tcpKeepAliveIdle, + options.tcpKeepAliveIntvl); + } + + @Override + protected void closeServerChannel(ServerSocketChannel fd) throws IOException { - return getClass().getSimpleName() + "[" + options.socketId + "]"; + fd.close(); } } diff --git a/src/test/java/zmq/TermEndpointIpcTest.java b/src/test/java/zmq/TermEndpointIpcTest.java index 016a397a3..b38954762 100644 --- a/src/test/java/zmq/TermEndpointIpcTest.java +++ b/src/test/java/zmq/TermEndpointIpcTest.java @@ -1,6 +1,8 @@ package zmq; -import java.util.UUID; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; public class TermEndpointIpcTest extends TestTermEndpoint { @@ -11,8 +13,9 @@ protected String endpointWildcard() } @Override - protected String endpointNormal() - { - return "ipc://" + UUID.randomUUID(); + protected String endpointNormal() throws IOException { + Path temp = Files.createTempFile("zmq-test-", ".sock"); + Files.delete(temp); + return "ipc://" + temp; } } From a412f0cad0d2260ad7e73e3d2abd4ed865e99a05 Mon Sep 17 00:00:00 2001 From: Spencer Park Date: Sat, 20 Jan 2024 14:26:15 -0800 Subject: [PATCH 2/8] Fix test --- src/main/java/zmq/io/net/ipc/IpcListener.java | 5 +++-- src/test/java/zmq/socket/pair/TestPairIpc.java | 16 +++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/java/zmq/io/net/ipc/IpcListener.java b/src/main/java/zmq/io/net/ipc/IpcListener.java index 5dd9edef8..beea48aea 100644 --- a/src/main/java/zmq/io/net/ipc/IpcListener.java +++ b/src/main/java/zmq/io/net/ipc/IpcListener.java @@ -79,10 +79,11 @@ protected void closeServerChannel(ServerSocketChannel fd) throws IOException fd.close(); } finally { - assert (this.boundSocketPath != null); Path socketPath = this.boundSocketPath; this.boundSocketPath = null; - Files.deleteIfExists(socketPath); + if (socketPath != null) { + Files.deleteIfExists(socketPath); + } } } } diff --git a/src/test/java/zmq/socket/pair/TestPairIpc.java b/src/test/java/zmq/socket/pair/TestPairIpc.java index 4f0e123a3..98d646306 100644 --- a/src/test/java/zmq/socket/pair/TestPairIpc.java +++ b/src/test/java/zmq/socket/pair/TestPairIpc.java @@ -3,8 +3,11 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertTrue; -import java.util.UUID; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; import org.junit.Test; @@ -18,22 +21,21 @@ public class TestPairIpc // Create REQ/ROUTER wiring. @Test(timeout = 5000) - public void testPairIpc() + public void testPairIpc() throws IOException { Ctx ctx = ZMQ.init(1); assertThat(ctx, notNullValue()); SocketBase pairBind = ZMQ.socket(ctx, ZMQ.ZMQ_PAIR); assertThat(pairBind, notNullValue()); - UUID random; - do { - random = UUID.randomUUID(); - } while (!ZMQ.bind(pairBind, "ipc:///tmp/tester/" + random)); + Path temp = Files.createTempFile("zmq-test-", ".sock"); + Files.delete(temp); + assertTrue(ZMQ.bind(pairBind, "ipc:///" + temp)); SocketBase pairConnect = ZMQ.socket(ctx, ZMQ.ZMQ_PAIR); assertThat(pairConnect, notNullValue()); - boolean brc = ZMQ.connect(pairConnect, "ipc:///tmp/tester/" + random); + boolean brc = ZMQ.connect(pairConnect, "ipc:///" + temp); assertThat(brc, is(true)); Helper.bounce(pairBind, pairConnect); From 857d4cd84fa78cda667e456086f054525e3693b5 Mon Sep 17 00:00:00 2001 From: Spencer Park Date: Sat, 20 Jan 2024 15:28:23 -0800 Subject: [PATCH 3/8] Multi release build --- pom.xml | 39 ++++++- src/main/java/zmq/io/net/Address.java | 8 +- src/main/java/zmq/io/net/ipc/IpcAddress.java | 100 ++++++++++++----- .../java/zmq/io/net/ipc/IpcConnecter.java | 25 +---- src/main/java/zmq/io/net/ipc/IpcListener.java | 79 +++---------- .../zmq/io/net/ipc/IpcViaLoopbackAddress.java | 105 ------------------ .../io/net/ipc/IpcViaLoopbackConnector.java | 16 --- .../io/net/ipc/IpcViaLoopbackListener.java | 40 ------- .../java16/zmq/io/net/ipc/IpcAddress.java | 104 +++++++++++++++++ .../java16/zmq/io/net/ipc/IpcConnecter.java | 33 ++++++ .../java16/zmq/io/net/ipc/IpcListener.java | 89 +++++++++++++++ 11 files changed, 358 insertions(+), 280 deletions(-) delete mode 100644 src/main/java/zmq/io/net/ipc/IpcViaLoopbackAddress.java delete mode 100644 src/main/java/zmq/io/net/ipc/IpcViaLoopbackConnector.java delete mode 100644 src/main/java/zmq/io/net/ipc/IpcViaLoopbackListener.java create mode 100644 src/main/java16/zmq/io/net/ipc/IpcAddress.java create mode 100644 src/main/java16/zmq/io/net/ipc/IpcConnecter.java create mode 100644 src/main/java16/zmq/io/net/ipc/IpcListener.java diff --git a/pom.xml b/pom.xml index 99166be01..1dda9f939 100644 --- a/pom.xml +++ b/pom.xml @@ -54,6 +54,43 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + + compile-java-8 + + compile + + + + compile-java-16 + compile + + compile + + + 16 + + ${project.basedir}/src/main/java16 + + true + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + + + + org.apache.maven.plugins maven-surefire-plugin @@ -89,7 +126,7 @@ biz.aQute.bnd bnd-maven-plugin - 6.4.0 + 7.0.0 true diff --git a/src/main/java/zmq/io/net/Address.java b/src/main/java/zmq/io/net/Address.java index 94775b0ef..2b5532806 100644 --- a/src/main/java/zmq/io/net/Address.java +++ b/src/main/java/zmq/io/net/Address.java @@ -1,9 +1,10 @@ package zmq.io.net; +import zmq.io.net.ipc.IpcAddress; + import java.net.InetSocketAddress; import java.net.ProtocolFamily; import java.net.SocketAddress; -import java.net.UnixDomainSocketAddress; public class Address { @@ -61,9 +62,8 @@ public Address(SocketAddress socketAddress) protocol = NetProtocol.tcp; resolved = null; } - else if (socketAddress instanceof UnixDomainSocketAddress) { - UnixDomainSocketAddress sockAddr = (UnixDomainSocketAddress) socketAddress; - this.address = sockAddr.getPath().toString(); + else if (IpcAddress.isIpcAddress(socketAddress)) { + this.address = IpcAddress.getAddress(socketAddress); protocol = NetProtocol.ipc; resolved = null; } diff --git a/src/main/java/zmq/io/net/ipc/IpcAddress.java b/src/main/java/zmq/io/net/ipc/IpcAddress.java index 85422085e..05ed94f9f 100644 --- a/src/main/java/zmq/io/net/ipc/IpcAddress.java +++ b/src/main/java/zmq/io/net/ipc/IpcAddress.java @@ -1,22 +1,23 @@ package zmq.io.net.ipc; -import java.io.IOException; +import java.net.Inet4Address; +import java.net.Inet6Address; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.NetworkInterface; import java.net.ProtocolFamily; import java.net.SocketAddress; +import java.net.SocketException; import java.net.StandardProtocolFamily; -import java.net.UnixDomainSocketAddress; -import java.nio.file.Files; -import java.nio.file.Path; +import java.util.Enumeration; -import org.zeromq.ZMQException; - -import zmq.ZError; +import zmq.ZMQ; import zmq.io.net.Address; import zmq.io.net.tcp.TcpAddress; +import zmq.util.Utils; public class IpcAddress implements Address.IZAddress { - // TODO unused? public static class IpcAddressMask extends TcpAddress { public IpcAddressMask(String addr, boolean ipv6) @@ -30,53 +31,73 @@ public boolean matchAddress(SocketAddress addr) } } - private String name; - private final UnixDomainSocketAddress address; + public static boolean isIpcAddress(SocketAddress address) { + return false; + } + + public static String getAddress(SocketAddress address) { + throw new IllegalArgumentException("Address is not unix domain socket address."); + } + + public static boolean isImplementedViaTcpLoopback() + { + return true; + } + + private String name; + private final InetSocketAddress address; public IpcAddress(String addr) { - // TODO inline? - this.address = this.resolve(addr); + String[] strings = addr.split(";"); + + address = resolve(strings[0]); + if (strings.length == 2 && !"".equals(strings[1])) { + resolve(strings[1]); + } } @Override public String toString() { - // TODO possible? if (name == null) { return ""; } - return "ipc://" + this.address.toString(); + return "ipc://" + name; } @Override public String toString(int port) { - // TODO why is port in the interface? + if ("*".equals(name)) { + String suffix = Utils.unhash(port - 10000); + return "ipc://" + suffix; + } return toString(); } - private UnixDomainSocketAddress resolve(String name) + private InetSocketAddress resolve(String name) { this.name = name; - if (!"*".equals(name)) { - return UnixDomainSocketAddress.of(name); + int hash = name.hashCode(); + if ("*".equals(name)) { + hash = 0; } - - try { - Path temp = Files.createTempFile("zmq-", ".sock"); - Files.delete(temp); - return UnixDomainSocketAddress.of(temp); - } - catch (IOException e) { - throw new ZMQException(e.getMessage(), ZError.EADDRNOTAVAIL, e); + else { + if (hash < 0) { + hash = -hash; + } + hash = hash % 55536; + hash += 10000; } + + return new InetSocketAddress(findAddress(), hash); } @Override - public UnixDomainSocketAddress address() + public SocketAddress address() { return address; } @@ -84,6 +105,27 @@ public UnixDomainSocketAddress address() @Override public ProtocolFamily family() { - return StandardProtocolFamily.UNIX; + return StandardProtocolFamily.INET; + } + + private InetAddress findAddress() + { + Class addressClass = ZMQ.PREFER_IPV6 ? Inet6Address.class : Inet4Address.class; + try { + for (Enumeration interfaces = NetworkInterface.getNetworkInterfaces(); interfaces + .hasMoreElements();) { + NetworkInterface net = interfaces.nextElement(); + for (Enumeration addresses = net.getInetAddresses(); addresses.hasMoreElements();) { + InetAddress inetAddress = addresses.nextElement(); + if (inetAddress.isLoopbackAddress() && addressClass.isInstance(inetAddress)) { + return inetAddress; + } + } + } + } + catch (SocketException e) { + throw new IllegalArgumentException(e); + } + throw new IllegalArgumentException("no address found " + (ZMQ.PREFER_IPV6 ? "IPV6" : "IPV4") + "local"); } -} +} \ No newline at end of file diff --git a/src/main/java/zmq/io/net/ipc/IpcConnecter.java b/src/main/java/zmq/io/net/ipc/IpcConnecter.java index 0704d31b5..604d591ce 100644 --- a/src/main/java/zmq/io/net/ipc/IpcConnecter.java +++ b/src/main/java/zmq/io/net/ipc/IpcConnecter.java @@ -1,33 +1,16 @@ package zmq.io.net.ipc; -import java.io.IOException; -import java.net.StandardProtocolFamily; -import java.nio.channels.SocketChannel; - import zmq.Options; import zmq.io.IOThread; import zmq.io.SessionBase; -import zmq.io.net.AbstractSocketConnecter; import zmq.io.net.Address; +import zmq.io.net.tcp.TcpConnecter; -public class IpcConnecter extends AbstractSocketConnecter +public class IpcConnecter extends TcpConnecter { - public IpcConnecter(IOThread ioThread, SessionBase session, final Options options, final Address addr, boolean wait) + public IpcConnecter(IOThread ioThread, SessionBase session, final Options options, final Address addr, + boolean wait) { super(ioThread, session, options, addr, wait); } - - @Override - protected SocketChannel openClient(Address.IZAddress address) throws IOException - { - SocketChannel fd = SocketChannel.open(StandardProtocolFamily.UNIX); - fd.configureBlocking(false); - return fd; - } - - @Override - protected void tuneConnectedChannel(SocketChannel channel) throws IOException - { - - } } diff --git a/src/main/java/zmq/io/net/ipc/IpcListener.java b/src/main/java/zmq/io/net/ipc/IpcListener.java index beea48aea..21d91e94a 100644 --- a/src/main/java/zmq/io/net/ipc/IpcListener.java +++ b/src/main/java/zmq/io/net/ipc/IpcListener.java @@ -1,89 +1,40 @@ package zmq.io.net.ipc; -import java.io.IOException; -import java.net.UnixDomainSocketAddress; -import java.nio.channels.ServerSocketChannel; -import java.nio.channels.SocketChannel; -import java.nio.file.Files; -import java.nio.file.Path; +import java.net.InetSocketAddress; import zmq.Options; import zmq.SocketBase; import zmq.io.IOThread; -import zmq.io.net.AbstractSocketListener; +import zmq.io.net.Address; +import zmq.io.net.tcp.TcpListener; -public class IpcListener extends AbstractSocketListener +// fake Unix domain socket +public class IpcListener extends TcpListener { - // bind will create this socket file but close will not remove it, so we need to do that ourselves on close. - private Path boundSocketPath; - public IpcListener(IOThread ioThread, SocketBase socket, final Options options) { super(ioThread, socket, options); + } // Get the bound address for use with wildcards @Override public String getAddress() { - // TODO - return super.getZAddress().toString(-1); + Address.IZAddress address = super.getZAddress(); + if (((InetSocketAddress) address.address()).getPort() == 0) { + return address(address); + } + return address.toString(); } // Set address to listen on. @Override public boolean setAddress(String addr) { - return super.setZAddress(new IpcAddress(addr)); - } - - @Override - protected ServerSocketChannel openServer(IpcAddress address) throws IOException - { - if (options.selectorChooser == null) { - return ServerSocketChannel.open(address.family()); - } - else { - return options.selectorChooser.choose(address, options).openServerSocketChannel(address.family()); - } - } - - @Override - protected void bindServer(ServerSocketChannel fd, IpcAddress address) throws IOException - { - fd.configureBlocking(false); - - UnixDomainSocketAddress socketAddress = address.address(); - fd.bind(socketAddress, options.backlog); - - assert (this.boundSocketPath == null); - this.boundSocketPath = socketAddress.getPath(); - } - - @Override - protected SocketChannel accept(ServerSocketChannel fd) throws IOException - { - return fd.accept(); - } - - @Override - protected void tuneAcceptedChannel(SocketChannel channel) throws IOException - { - // no-op - } + IpcAddress address = new IpcAddress(addr); - @Override - protected void closeServerChannel(ServerSocketChannel fd) throws IOException - { - try { - fd.close(); - } - finally { - Path socketPath = this.boundSocketPath; - this.boundSocketPath = null; - if (socketPath != null) { - Files.deleteIfExists(socketPath); - } - } + InetSocketAddress sock = (InetSocketAddress) address.address(); + return super.setAddress(sock); } -} +} \ No newline at end of file diff --git a/src/main/java/zmq/io/net/ipc/IpcViaLoopbackAddress.java b/src/main/java/zmq/io/net/ipc/IpcViaLoopbackAddress.java deleted file mode 100644 index a7e2836af..000000000 --- a/src/main/java/zmq/io/net/ipc/IpcViaLoopbackAddress.java +++ /dev/null @@ -1,105 +0,0 @@ -package zmq.io.net.ipc; - -import java.net.Inet4Address; -import java.net.Inet6Address; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.NetworkInterface; -import java.net.ProtocolFamily; -import java.net.SocketAddress; -import java.net.SocketException; -import java.net.StandardProtocolFamily; -import java.util.Enumeration; - -import zmq.ZMQ; -import zmq.io.net.Address; -import zmq.util.Utils; - -public class IpcViaLoopbackAddress implements Address.IZAddress -{ - - private String name; - private final InetSocketAddress address; - - public IpcViaLoopbackAddress(String addr) - { - String[] strings = addr.split(";"); - - address = resolve(strings[0]); - if (strings.length == 2 && !"".equals(strings[1])) { - resolve(strings[1]); - } - } - - @Override - public String toString() - { - if (name == null) { - return ""; - } - - return "ipc://" + name; - } - - @Override - public String toString(int port) - { - if ("*".equals(name)) { - String suffix = Utils.unhash(port - 10000); - return "ipc://" + suffix; - } - return toString(); - } - - private InetSocketAddress resolve(String name) - { - this.name = name; - - int hash = name.hashCode(); - if ("*".equals(name)) { - hash = 0; - } - else { - if (hash < 0) { - hash = -hash; - } - hash = hash % 55536; - hash += 10000; - } - - return new InetSocketAddress(findAddress(), hash); - } - - @Override - public SocketAddress address() - { - return address; - } - - @Override - public ProtocolFamily family() - { - return StandardProtocolFamily.INET; - } - - private InetAddress findAddress() - { - Class addressClass = ZMQ.PREFER_IPV6 ? Inet6Address.class : Inet4Address.class; - try { - for (Enumeration interfaces = NetworkInterface.getNetworkInterfaces(); interfaces - .hasMoreElements();) { - NetworkInterface net = interfaces.nextElement(); - for (Enumeration addresses = net.getInetAddresses(); addresses.hasMoreElements();) { - InetAddress inetAddress = addresses.nextElement(); - if (inetAddress.isLoopbackAddress() && addressClass.isInstance(inetAddress)) { - return inetAddress; - } - } - } - } - catch (SocketException e) { - throw new IllegalArgumentException(e); - } - throw new IllegalArgumentException("no address found " + (ZMQ.PREFER_IPV6 ? "IPV6" : "IPV4") + "local"); - } -} \ No newline at end of file diff --git a/src/main/java/zmq/io/net/ipc/IpcViaLoopbackConnector.java b/src/main/java/zmq/io/net/ipc/IpcViaLoopbackConnector.java deleted file mode 100644 index 43ef6a45b..000000000 --- a/src/main/java/zmq/io/net/ipc/IpcViaLoopbackConnector.java +++ /dev/null @@ -1,16 +0,0 @@ -package zmq.io.net.ipc; - -import zmq.Options; -import zmq.io.IOThread; -import zmq.io.SessionBase; -import zmq.io.net.Address; -import zmq.io.net.tcp.TcpConnecter; - -public class IpcViaLoopbackConnector extends TcpConnecter -{ - public IpcViaLoopbackConnector(IOThread ioThread, SessionBase session, final Options options, final Address addr, - boolean wait) - { - super(ioThread, session, options, addr, wait); - } -} diff --git a/src/main/java/zmq/io/net/ipc/IpcViaLoopbackListener.java b/src/main/java/zmq/io/net/ipc/IpcViaLoopbackListener.java deleted file mode 100644 index 0092b6033..000000000 --- a/src/main/java/zmq/io/net/ipc/IpcViaLoopbackListener.java +++ /dev/null @@ -1,40 +0,0 @@ -package zmq.io.net.ipc; - -import java.net.InetSocketAddress; - -import zmq.Options; -import zmq.SocketBase; -import zmq.io.IOThread; -import zmq.io.net.Address; -import zmq.io.net.tcp.TcpListener; - -// fake Unix domain socket -public class IpcViaLoopbackListener extends TcpListener -{ - public IpcViaLoopbackListener(IOThread ioThread, SocketBase socket, final Options options) - { - super(ioThread, socket, options); - - } - - // Get the bound address for use with wildcards - @Override - public String getAddress() - { - Address.IZAddress address = super.getZAddress(); - if (((InetSocketAddress) address.address()).getPort() == 0) { - return address(address); - } - return address.toString(); - } - - // Set address to listen on. - @Override - public boolean setAddress(String addr) - { - var address = new IpcViaLoopbackAddress(addr); - - InetSocketAddress sock = (InetSocketAddress) address.address(); - return super.setAddress(sock); - } -} \ No newline at end of file diff --git a/src/main/java16/zmq/io/net/ipc/IpcAddress.java b/src/main/java16/zmq/io/net/ipc/IpcAddress.java new file mode 100644 index 000000000..ca1ac9967 --- /dev/null +++ b/src/main/java16/zmq/io/net/ipc/IpcAddress.java @@ -0,0 +1,104 @@ +package zmq.io.net.ipc; + +import java.io.IOException; +import java.net.ProtocolFamily; +import java.net.SocketAddress; +import java.net.StandardProtocolFamily; +import java.net.UnixDomainSocketAddress; +import java.nio.file.Files; +import java.nio.file.Path; + +import org.zeromq.ZMQException; + +import zmq.ZError; +import zmq.io.net.Address; +import zmq.io.net.tcp.TcpAddress; + +public class IpcAddress implements Address.IZAddress +{ + // TODO unused? + public static class IpcAddressMask extends TcpAddress + { + public IpcAddressMask(String addr, boolean ipv6) + { + super(addr, ipv6); + } + + public boolean matchAddress(SocketAddress addr) + { + return address().equals(addr); + } + } + + public static boolean isIpcAddress(SocketAddress address) { + return address instanceof UnixDomainSocketAddress; + } + + public static String getAddress(SocketAddress address) { + assert (isIpcAddress(address)); + var unixDomainSocketAddress = (UnixDomainSocketAddress) address; + return unixDomainSocketAddress.getPath().toString(); + } + + public static boolean isImplementedViaTcpLoopback() + { + return false; + } + + private String name; + private final UnixDomainSocketAddress address; + + public IpcAddress(String addr) + { + // TODO inline? + this.address = this.resolve(addr); + } + + @Override + public String toString() + { + // TODO possible? + if (name == null) { + return ""; + } + + return "ipc://" + this.address.toString(); + } + + @Override + public String toString(int port) + { + // TODO why is port in the interface? + return toString(); + } + + private UnixDomainSocketAddress resolve(String name) + { + this.name = name; + + if (!"*".equals(name)) { + return UnixDomainSocketAddress.of(name); + } + + try { + Path temp = Files.createTempFile("zmq-", ".sock"); + Files.delete(temp); + return UnixDomainSocketAddress.of(temp); + } + catch (IOException e) { + throw new ZMQException(e.getMessage(), ZError.EADDRNOTAVAIL, e); + } + } + + @Override + public UnixDomainSocketAddress address() + { + return address; + } + + @Override + public ProtocolFamily family() + { + return StandardProtocolFamily.UNIX; + } +} diff --git a/src/main/java16/zmq/io/net/ipc/IpcConnecter.java b/src/main/java16/zmq/io/net/ipc/IpcConnecter.java new file mode 100644 index 000000000..0704d31b5 --- /dev/null +++ b/src/main/java16/zmq/io/net/ipc/IpcConnecter.java @@ -0,0 +1,33 @@ +package zmq.io.net.ipc; + +import java.io.IOException; +import java.net.StandardProtocolFamily; +import java.nio.channels.SocketChannel; + +import zmq.Options; +import zmq.io.IOThread; +import zmq.io.SessionBase; +import zmq.io.net.AbstractSocketConnecter; +import zmq.io.net.Address; + +public class IpcConnecter extends AbstractSocketConnecter +{ + public IpcConnecter(IOThread ioThread, SessionBase session, final Options options, final Address addr, boolean wait) + { + super(ioThread, session, options, addr, wait); + } + + @Override + protected SocketChannel openClient(Address.IZAddress address) throws IOException + { + SocketChannel fd = SocketChannel.open(StandardProtocolFamily.UNIX); + fd.configureBlocking(false); + return fd; + } + + @Override + protected void tuneConnectedChannel(SocketChannel channel) throws IOException + { + + } +} diff --git a/src/main/java16/zmq/io/net/ipc/IpcListener.java b/src/main/java16/zmq/io/net/ipc/IpcListener.java new file mode 100644 index 000000000..beea48aea --- /dev/null +++ b/src/main/java16/zmq/io/net/ipc/IpcListener.java @@ -0,0 +1,89 @@ +package zmq.io.net.ipc; + +import java.io.IOException; +import java.net.UnixDomainSocketAddress; +import java.nio.channels.ServerSocketChannel; +import java.nio.channels.SocketChannel; +import java.nio.file.Files; +import java.nio.file.Path; + +import zmq.Options; +import zmq.SocketBase; +import zmq.io.IOThread; +import zmq.io.net.AbstractSocketListener; + +public class IpcListener extends AbstractSocketListener +{ + // bind will create this socket file but close will not remove it, so we need to do that ourselves on close. + private Path boundSocketPath; + + public IpcListener(IOThread ioThread, SocketBase socket, final Options options) + { + super(ioThread, socket, options); + } + + // Get the bound address for use with wildcards + @Override + public String getAddress() + { + // TODO + return super.getZAddress().toString(-1); + } + + // Set address to listen on. + @Override + public boolean setAddress(String addr) + { + return super.setZAddress(new IpcAddress(addr)); + } + + @Override + protected ServerSocketChannel openServer(IpcAddress address) throws IOException + { + if (options.selectorChooser == null) { + return ServerSocketChannel.open(address.family()); + } + else { + return options.selectorChooser.choose(address, options).openServerSocketChannel(address.family()); + } + } + + @Override + protected void bindServer(ServerSocketChannel fd, IpcAddress address) throws IOException + { + fd.configureBlocking(false); + + UnixDomainSocketAddress socketAddress = address.address(); + fd.bind(socketAddress, options.backlog); + + assert (this.boundSocketPath == null); + this.boundSocketPath = socketAddress.getPath(); + } + + @Override + protected SocketChannel accept(ServerSocketChannel fd) throws IOException + { + return fd.accept(); + } + + @Override + protected void tuneAcceptedChannel(SocketChannel channel) throws IOException + { + // no-op + } + + @Override + protected void closeServerChannel(ServerSocketChannel fd) throws IOException + { + try { + fd.close(); + } + finally { + Path socketPath = this.boundSocketPath; + this.boundSocketPath = null; + if (socketPath != null) { + Files.deleteIfExists(socketPath); + } + } + } +} From 5dea55452d70f741a961b6009d14bd00ab547cae Mon Sep 17 00:00:00 2001 From: Spencer Park Date: Sat, 20 Jan 2024 15:41:52 -0800 Subject: [PATCH 4/8] revert --- src/main/java/zmq/io/net/ipc/IpcListener.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/zmq/io/net/ipc/IpcListener.java b/src/main/java/zmq/io/net/ipc/IpcListener.java index 21d91e94a..5db4bc0a9 100644 --- a/src/main/java/zmq/io/net/ipc/IpcListener.java +++ b/src/main/java/zmq/io/net/ipc/IpcListener.java @@ -5,12 +5,12 @@ import zmq.Options; import zmq.SocketBase; import zmq.io.IOThread; -import zmq.io.net.Address; import zmq.io.net.tcp.TcpListener; // fake Unix domain socket public class IpcListener extends TcpListener { + private IpcAddress address; public IpcListener(IOThread ioThread, SocketBase socket, final Options options) { super(ioThread, socket, options); @@ -21,7 +21,6 @@ public IpcListener(IOThread ioThread, SocketBase socket, final Options options) @Override public String getAddress() { - Address.IZAddress address = super.getZAddress(); if (((InetSocketAddress) address.address()).getPort() == 0) { return address(address); } @@ -32,7 +31,7 @@ public String getAddress() @Override public boolean setAddress(String addr) { - IpcAddress address = new IpcAddress(addr); + address = new IpcAddress(addr); InetSocketAddress sock = (InetSocketAddress) address.address(); return super.setAddress(sock); From 79ffa8e1cd9170e66adf1f73650d52eead28e430 Mon Sep 17 00:00:00 2001 From: Spencer Park Date: Sat, 20 Jan 2024 15:56:30 -0800 Subject: [PATCH 5/8] Checkstyle --- pom.xml | 1 + src/main/java/zmq/io/net/ipc/IpcAddress.java | 15 +++++++++------ src/main/java/zmq/io/net/ipc/IpcConnecter.java | 3 +-- src/main/java/zmq/io/net/ipc/IpcListener.java | 3 ++- src/main/java16/zmq/io/net/ipc/IpcAddress.java | 6 ++++-- src/main/java16/zmq/io/net/ipc/IpcConnecter.java | 2 +- src/test/java/zmq/TermEndpointIpcTest.java | 3 ++- 7 files changed, 20 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index 1dda9f939..e469be650 100644 --- a/pom.xml +++ b/pom.xml @@ -365,6 +365,7 @@ true true + ${project.basedir}/src/main/java,${project.basedir}/src/main/java16 ${project.basedir}/src/checkstyle/checks.xml true **/guide/* diff --git a/src/main/java/zmq/io/net/ipc/IpcAddress.java b/src/main/java/zmq/io/net/ipc/IpcAddress.java index 05ed94f9f..e163335fa 100644 --- a/src/main/java/zmq/io/net/ipc/IpcAddress.java +++ b/src/main/java/zmq/io/net/ipc/IpcAddress.java @@ -31,11 +31,13 @@ public boolean matchAddress(SocketAddress addr) } } - public static boolean isIpcAddress(SocketAddress address) { + public static boolean isIpcAddress(SocketAddress address) + { return false; } - public static String getAddress(SocketAddress address) { + public static String getAddress(SocketAddress address) + { throw new IllegalArgumentException("Address is not unix domain socket address."); } @@ -112,10 +114,11 @@ private InetAddress findAddress() { Class addressClass = ZMQ.PREFER_IPV6 ? Inet6Address.class : Inet4Address.class; try { - for (Enumeration interfaces = NetworkInterface.getNetworkInterfaces(); interfaces - .hasMoreElements();) { + Enumeration interfaces = NetworkInterface.getNetworkInterfaces(); + while (interfaces.hasMoreElements()) { NetworkInterface net = interfaces.nextElement(); - for (Enumeration addresses = net.getInetAddresses(); addresses.hasMoreElements();) { + Enumeration addresses = net.getInetAddresses(); + while (addresses.hasMoreElements()) { InetAddress inetAddress = addresses.nextElement(); if (inetAddress.isLoopbackAddress() && addressClass.isInstance(inetAddress)) { return inetAddress; @@ -128,4 +131,4 @@ private InetAddress findAddress() } throw new IllegalArgumentException("no address found " + (ZMQ.PREFER_IPV6 ? "IPV6" : "IPV4") + "local"); } -} \ No newline at end of file +} diff --git a/src/main/java/zmq/io/net/ipc/IpcConnecter.java b/src/main/java/zmq/io/net/ipc/IpcConnecter.java index 604d591ce..717240314 100644 --- a/src/main/java/zmq/io/net/ipc/IpcConnecter.java +++ b/src/main/java/zmq/io/net/ipc/IpcConnecter.java @@ -8,8 +8,7 @@ public class IpcConnecter extends TcpConnecter { - public IpcConnecter(IOThread ioThread, SessionBase session, final Options options, final Address addr, - boolean wait) + public IpcConnecter(IOThread ioThread, SessionBase session, final Options options, final Address addr, boolean wait) { super(ioThread, session, options, addr, wait); } diff --git a/src/main/java/zmq/io/net/ipc/IpcListener.java b/src/main/java/zmq/io/net/ipc/IpcListener.java index 5db4bc0a9..450e18f2e 100644 --- a/src/main/java/zmq/io/net/ipc/IpcListener.java +++ b/src/main/java/zmq/io/net/ipc/IpcListener.java @@ -11,6 +11,7 @@ public class IpcListener extends TcpListener { private IpcAddress address; + public IpcListener(IOThread ioThread, SocketBase socket, final Options options) { super(ioThread, socket, options); @@ -36,4 +37,4 @@ public boolean setAddress(String addr) InetSocketAddress sock = (InetSocketAddress) address.address(); return super.setAddress(sock); } -} \ No newline at end of file +} diff --git a/src/main/java16/zmq/io/net/ipc/IpcAddress.java b/src/main/java16/zmq/io/net/ipc/IpcAddress.java index ca1ac9967..2e01abb21 100644 --- a/src/main/java16/zmq/io/net/ipc/IpcAddress.java +++ b/src/main/java16/zmq/io/net/ipc/IpcAddress.java @@ -30,11 +30,13 @@ public boolean matchAddress(SocketAddress addr) } } - public static boolean isIpcAddress(SocketAddress address) { + public static boolean isIpcAddress(SocketAddress address) + { return address instanceof UnixDomainSocketAddress; } - public static String getAddress(SocketAddress address) { + public static String getAddress(SocketAddress address) + { assert (isIpcAddress(address)); var unixDomainSocketAddress = (UnixDomainSocketAddress) address; return unixDomainSocketAddress.getPath().toString(); diff --git a/src/main/java16/zmq/io/net/ipc/IpcConnecter.java b/src/main/java16/zmq/io/net/ipc/IpcConnecter.java index 0704d31b5..d5b961333 100644 --- a/src/main/java16/zmq/io/net/ipc/IpcConnecter.java +++ b/src/main/java16/zmq/io/net/ipc/IpcConnecter.java @@ -28,6 +28,6 @@ protected SocketChannel openClient(Address.IZAddress address) throws IOException @Override protected void tuneConnectedChannel(SocketChannel channel) throws IOException { - + // no-op } } diff --git a/src/test/java/zmq/TermEndpointIpcTest.java b/src/test/java/zmq/TermEndpointIpcTest.java index b38954762..733abad69 100644 --- a/src/test/java/zmq/TermEndpointIpcTest.java +++ b/src/test/java/zmq/TermEndpointIpcTest.java @@ -13,7 +13,8 @@ protected String endpointWildcard() } @Override - protected String endpointNormal() throws IOException { + protected String endpointNormal() throws IOException + { Path temp = Files.createTempFile("zmq-test-", ".sock"); Files.delete(temp); return "ipc://" + temp; From 477696838d0d0138f0b302c3b15f46a2fd7f2175 Mon Sep 17 00:00:00 2001 From: Spencer Park Date: Sat, 27 Jan 2024 19:27:29 -0800 Subject: [PATCH 6/8] Convert to multi-module --- jeromq-ipc/pom.xml | 28 ++++ .../main/java}/zmq/io/net/ipc/IpcAddress.java | 0 .../java}/zmq/io/net/ipc/IpcConnecter.java | 0 .../java}/zmq/io/net/ipc/IpcListener.java | 0 jeromq/pom.xml | 104 ++++++++++++++ .../main/java/org/zeromq/ManagedContext.java | 0 .../src}/main/java/org/zeromq/SocketType.java | 0 .../org/zeromq/UncheckedZMQException.java | 0 .../src}/main/java/org/zeromq/Utils.java | 0 .../src}/main/java/org/zeromq/ZActor.java | 0 .../src}/main/java/org/zeromq/ZAgent.java | 0 .../src}/main/java/org/zeromq/ZAuth.java | 0 .../src}/main/java/org/zeromq/ZBeacon.java | 0 .../src}/main/java/org/zeromq/ZCert.java | 0 .../src}/main/java/org/zeromq/ZCertStore.java | 0 .../src}/main/java/org/zeromq/ZConfig.java | 0 .../src}/main/java/org/zeromq/ZContext.java | 0 .../src}/main/java/org/zeromq/ZEvent.java | 0 .../src}/main/java/org/zeromq/ZFrame.java | 0 .../src}/main/java/org/zeromq/ZLoop.java | 0 .../src}/main/java/org/zeromq/ZMQ.java | 0 .../main/java/org/zeromq/ZMQException.java | 0 .../src}/main/java/org/zeromq/ZMQQueue.java | 0 .../src}/main/java/org/zeromq/ZMonitor.java | 0 .../src}/main/java/org/zeromq/ZMsg.java | 0 .../src}/main/java/org/zeromq/ZPoller.java | 0 .../src}/main/java/org/zeromq/ZProxy.java | 0 .../src}/main/java/org/zeromq/ZSocket.java | 0 .../src}/main/java/org/zeromq/ZStar.java | 0 .../src}/main/java/org/zeromq/ZThread.java | 0 .../src}/main/java/org/zeromq/ZTimer.java | 0 .../main/java/org/zeromq/package-info.java | 0 .../main/java/org/zeromq/proto/ZNeedle.java | 0 .../main/java/org/zeromq/proto/ZPicture.java | 0 .../java/org/zeromq/proto/package-info.java | 0 .../java/org/zeromq/timer/TimerHandler.java | 0 .../main/java/org/zeromq/timer/ZTicker.java | 0 .../main/java/org/zeromq/timer/ZTicket.java | 0 .../main/java/org/zeromq/timer/ZTimer.java | 0 .../java/org/zeromq/timer/package-info.java | 0 .../src}/main/java/org/zeromq/util/ZData.java | 0 .../main/java/org/zeromq/util/ZDigest.java | 0 .../main/java/org/zeromq/util/ZMetadata.java | 0 .../java/org/zeromq/util/package-info.java | 0 .../src}/main/java/zmq/Command.java | 0 {src => jeromq/src}/main/java/zmq/Config.java | 0 {src => jeromq/src}/main/java/zmq/Ctx.java | 0 .../src}/main/java/zmq/IMailbox.java | 0 .../src}/main/java/zmq/Mailbox.java | 0 .../src}/main/java/zmq/MailboxSafe.java | 0 {src => jeromq/src}/main/java/zmq/Msg.java | 0 .../src}/main/java/zmq/Options.java | 0 {src => jeromq/src}/main/java/zmq/Own.java | 0 {src => jeromq/src}/main/java/zmq/Proxy.java | 0 {src => jeromq/src}/main/java/zmq/Reaper.java | 0 .../src}/main/java/zmq/Signaler.java | 0 .../src}/main/java/zmq/SocketBase.java | 0 {src => jeromq/src}/main/java/zmq/Utils.java | 0 {src => jeromq/src}/main/java/zmq/ZError.java | 0 {src => jeromq/src}/main/java/zmq/ZMQ.java | 0 .../src}/main/java/zmq/ZObject.java | 0 .../java/zmq/io/EngineNotImplemented.java | 0 .../main/java/zmq/io/HelloMsgSession.java | 0 .../src}/main/java/zmq/io/IEngine.java | 0 .../src}/main/java/zmq/io/IOObject.java | 0 .../src}/main/java/zmq/io/IOThread.java | 0 .../src}/main/java/zmq/io/Metadata.java | 0 .../src}/main/java/zmq/io/Msgs.java | 0 .../src}/main/java/zmq/io/SessionBase.java | 0 .../src}/main/java/zmq/io/StreamEngine.java | 0 .../src}/main/java/zmq/io/coder/Decoder.java | 0 .../main/java/zmq/io/coder/DecoderBase.java | 0 .../src}/main/java/zmq/io/coder/Encoder.java | 0 .../main/java/zmq/io/coder/EncoderBase.java | 0 .../src}/main/java/zmq/io/coder/IDecoder.java | 0 .../src}/main/java/zmq/io/coder/IEncoder.java | 0 .../java/zmq/io/coder/raw/RawDecoder.java | 0 .../java/zmq/io/coder/raw/RawEncoder.java | 0 .../main/java/zmq/io/coder/v1/V1Decoder.java | 0 .../main/java/zmq/io/coder/v1/V1Encoder.java | 0 .../main/java/zmq/io/coder/v1/V1Protocol.java | 0 .../main/java/zmq/io/coder/v2/V2Decoder.java | 0 .../main/java/zmq/io/coder/v2/V2Encoder.java | 0 .../main/java/zmq/io/coder/v2/V2Protocol.java | 0 .../main/java/zmq/io/mechanism/Mechanism.java | 0 .../java/zmq/io/mechanism/Mechanisms.java | 0 .../java/zmq/io/mechanism/NullMechanism.java | 0 .../java/zmq/io/mechanism/curve/Curve.java | 0 .../mechanism/curve/CurveClientMechanism.java | 0 .../mechanism/curve/CurveServerMechanism.java | 0 .../gssapi/GssapiClientMechanism.java | 0 .../gssapi/GssapiServerMechanism.java | 0 .../mechanism/plain/PlainClientMechanism.java | 0 .../mechanism/plain/PlainServerMechanism.java | 0 .../zmq/io/net/AbstractSocketConnecter.java | 0 .../zmq/io/net/AbstractSocketListener.java | 0 .../src}/main/java/zmq/io/net/Address.java | 0 .../src}/main/java/zmq/io/net/Listener.java | 0 .../main/java/zmq/io/net/NetProtocol.java | 0 .../zmq/io/net/SelectorProviderChooser.java | 0 .../main/java/zmq/io/net/ipc/IpcAddress.java | 0 .../java/zmq/io/net/ipc/IpcConnecter.java | 0 .../main/java/zmq/io/net/ipc/IpcListener.java | 0 .../main/java/zmq/io/net/norm/NormEngine.java | 0 .../main/java/zmq/io/net/pgm/PgmReceiver.java | 0 .../main/java/zmq/io/net/pgm/PgmSender.java | 0 .../java/zmq/io/net/tcp/SocksConnecter.java | 0 .../main/java/zmq/io/net/tcp/TcpAddress.java | 0 .../java/zmq/io/net/tcp/TcpConnecter.java | 0 .../main/java/zmq/io/net/tcp/TcpListener.java | 0 .../main/java/zmq/io/net/tcp/TcpUtils.java | 0 .../java/zmq/io/net/tipc/TipcConnecter.java | 0 .../java/zmq/io/net/tipc/TipcListener.java | 0 .../src}/main/java/zmq/msg/MsgAllocator.java | 0 .../main/java/zmq/msg/MsgAllocatorDirect.java | 0 .../main/java/zmq/msg/MsgAllocatorHeap.java | 0 .../java/zmq/msg/MsgAllocatorThreshold.java | 0 .../src}/main/java/zmq/msg/package-info.java | 0 .../src}/main/java/zmq/package-info.java | 0 .../src}/main/java/zmq/pipe/DBuffer.java | 0 .../src}/main/java/zmq/pipe/Pipe.java | 0 .../src}/main/java/zmq/pipe/YPipe.java | 0 .../src}/main/java/zmq/pipe/YPipeBase.java | 0 .../main/java/zmq/pipe/YPipeConflate.java | 0 .../src}/main/java/zmq/pipe/YQueue.java | 0 .../src}/main/java/zmq/poll/IPollEvents.java | 0 .../src}/main/java/zmq/poll/PollItem.java | 0 .../src}/main/java/zmq/poll/Poller.java | 0 .../src}/main/java/zmq/poll/PollerBase.java | 0 .../src}/main/java/zmq/socket/Channel.java | 0 .../src}/main/java/zmq/socket/FQ.java | 0 .../src}/main/java/zmq/socket/LB.java | 0 .../src}/main/java/zmq/socket/Pair.java | 0 .../src}/main/java/zmq/socket/Peer.java | 0 .../src}/main/java/zmq/socket/Raw.java | 0 .../src}/main/java/zmq/socket/Sockets.java | 0 .../src}/main/java/zmq/socket/Stream.java | 0 .../java/zmq/socket/clientserver/Client.java | 0 .../java/zmq/socket/clientserver/Server.java | 0 .../main/java/zmq/socket/pipeline/Pull.java | 0 .../main/java/zmq/socket/pipeline/Push.java | 0 .../main/java/zmq/socket/pubsub/Dist.java | 0 .../main/java/zmq/socket/pubsub/Mtrie.java | 0 .../src}/main/java/zmq/socket/pubsub/Pub.java | 0 .../src}/main/java/zmq/socket/pubsub/Sub.java | 0 .../main/java/zmq/socket/pubsub/Trie.java | 0 .../main/java/zmq/socket/pubsub/XPub.java | 0 .../main/java/zmq/socket/pubsub/XSub.java | 0 .../main/java/zmq/socket/radiodish/Dish.java | 0 .../main/java/zmq/socket/radiodish/Radio.java | 0 .../main/java/zmq/socket/reqrep/Dealer.java | 0 .../src}/main/java/zmq/socket/reqrep/Rep.java | 0 .../src}/main/java/zmq/socket/reqrep/Req.java | 0 .../main/java/zmq/socket/reqrep/Router.java | 0 .../java/zmq/socket/scattergather/Gather.java | 0 .../zmq/socket/scattergather/Scatter.java | 0 .../src}/main/java/zmq/util/Blob.java | 0 .../src}/main/java/zmq/util/Clock.java | 0 .../src}/main/java/zmq/util/Draft.java | 0 .../src}/main/java/zmq/util/Errno.java | 0 .../src}/main/java/zmq/util/MultiMap.java | 0 .../src}/main/java/zmq/util/Objects.java | 0 .../src}/main/java/zmq/util/Timers.java | 0 .../src}/main/java/zmq/util/Utils.java | 0 .../main/java/zmq/util/ValueReference.java | 0 .../src}/main/java/zmq/util/Wire.java | 0 .../src}/main/java/zmq/util/Z85.java | 0 .../java/zmq/util/function/BiFunction.java | 0 .../main/java/zmq/util/function/Consumer.java | 0 .../main/java/zmq/util/function/Function.java | 0 .../main/java/zmq/util/function/Supplier.java | 0 {src => jeromq/src}/test/java/guide/MDP.java | 0 .../src}/test/java/guide/ZHelper.java | 0 .../src}/test/java/guide/asyncsrv.java | 0 .../src}/test/java/guide/bstar.java | 0 .../src}/test/java/guide/bstarcli.java | 0 .../src}/test/java/guide/bstarsrv.java | 0 .../src}/test/java/guide/bstarsrv2.java | 0 .../src}/test/java/guide/clone.java | 0 .../src}/test/java/guide/clonecli1.java | 0 .../src}/test/java/guide/clonecli2.java | 0 .../src}/test/java/guide/clonecli3.java | 0 .../src}/test/java/guide/clonecli4.java | 0 .../src}/test/java/guide/clonecli5.java | 0 .../src}/test/java/guide/clonecli6.java | 0 .../src}/test/java/guide/clonesrv1.java | 0 .../src}/test/java/guide/clonesrv2.java | 0 .../src}/test/java/guide/clonesrv3.java | 0 .../src}/test/java/guide/clonesrv4.java | 0 .../src}/test/java/guide/clonesrv5.java | 0 .../src}/test/java/guide/clonesrv6.java | 0 .../src}/test/java/guide/espresso.java | 0 .../src}/test/java/guide/flcliapi.java | 0 .../src}/test/java/guide/flclient1.java | 0 .../src}/test/java/guide/flclient2.java | 0 .../src}/test/java/guide/flclient3.java | 0 .../src}/test/java/guide/flserver1.java | 0 .../src}/test/java/guide/flserver2.java | 0 .../src}/test/java/guide/flserver3.java | 0 .../src}/test/java/guide/hwclient.java | 0 .../src}/test/java/guide/hwserver.java | 0 .../src}/test/java/guide/identity.java | 0 .../src}/test/java/guide/interrupt.java | 0 .../src}/test/java/guide/kvmsg.java | 0 .../src}/test/java/guide/kvmsgTest.java | 0 .../src}/test/java/guide/kvsimple.java | 0 .../src}/test/java/guide/lbbroker.java | 0 .../src}/test/java/guide/lbbroker2.java | 0 .../src}/test/java/guide/lbbroker3.java | 0 .../src}/test/java/guide/lpclient.java | 0 .../src}/test/java/guide/lpserver.java | 0 .../src}/test/java/guide/lruqueue3.java | 0 .../src}/test/java/guide/lvcache.java | 0 .../src}/test/java/guide/mdbroker.java | 0 .../src}/test/java/guide/mdcliapi.java | 0 .../src}/test/java/guide/mdcliapi2.java | 0 .../src}/test/java/guide/mdclient.java | 0 .../src}/test/java/guide/mdclient2.java | 0 .../src}/test/java/guide/mdworker.java | 0 .../src}/test/java/guide/mdwrkapi.java | 0 .../src}/test/java/guide/mmiecho.java | 0 .../src}/test/java/guide/msgqueue.java | 0 .../src}/test/java/guide/mspoller.java | 0 .../src}/test/java/guide/msreader.java | 0 .../src}/test/java/guide/mtrelay.java | 0 .../src}/test/java/guide/mtserver.java | 0 .../src}/test/java/guide/pathopub.java | 0 .../src}/test/java/guide/pathosub.java | 0 .../src}/test/java/guide/peering1.java | 0 .../src}/test/java/guide/peering2.java | 0 .../src}/test/java/guide/peering3.java | 0 .../src}/test/java/guide/ppqueue.java | 0 .../src}/test/java/guide/ppworker.java | 0 .../src}/test/java/guide/psenvpub.java | 0 .../src}/test/java/guide/psenvsub.java | 0 .../src}/test/java/guide/rrbroker.java | 0 .../src}/test/java/guide/rrclient.java | 0 .../src}/test/java/guide/rrworker.java | 0 .../src}/test/java/guide/rtdealer.java | 0 .../src}/test/java/guide/rtmama.java | 0 .../src}/test/java/guide/rtpapa.java | 0 .../src}/test/java/guide/rtreq.java | 0 .../src}/test/java/guide/spqueue.java | 0 .../src}/test/java/guide/spworker.java | 0 .../src}/test/java/guide/suisnail.java | 0 .../src}/test/java/guide/syncpub.java | 0 .../src}/test/java/guide/syncsub.java | 0 .../src}/test/java/guide/tasksink.java | 0 .../src}/test/java/guide/tasksink2.java | 0 .../src}/test/java/guide/taskvent.java | 0 .../src}/test/java/guide/taskwork.java | 0 .../src}/test/java/guide/taskwork2.java | 0 .../src}/test/java/guide/ticlient.java | 0 .../src}/test/java/guide/titanic.java | 0 .../src}/test/java/guide/tripping.java | 0 .../src}/test/java/guide/version.java | 0 .../src}/test/java/guide/wuclient.java | 0 .../src}/test/java/guide/wuproxy.java | 0 .../src}/test/java/guide/wuserver.java | 0 .../test/java/org/zeromq/ByteBuffersTest.java | 0 .../java/org/zeromq/DealerDealerTest.java | 0 .../java/org/zeromq/HighWatermarkTest.java | 0 ...oidPiratServerWithLazyPiratClientTest.java | 0 .../src}/test/java/org/zeromq/PubSubTest.java | 0 .../test/java/org/zeromq/PushPullTest.java | 0 .../src}/test/java/org/zeromq/ReqRepTest.java | 0 .../java/org/zeromq/SelectorProviderTest.java | 0 .../org/zeromq/TemporaryFolderFinder.java | 0 .../zeromq/TestDisconnectInprocZeromq.java | 0 .../java/org/zeromq/TestEventResolution.java | 0 .../src}/test/java/org/zeromq/TestEvents.java | 0 .../src}/test/java/org/zeromq/TestPoller.java | 0 .../src}/test/java/org/zeromq/TestProxy.java | 0 .../org/zeromq/TestPushPullThreadedTcp.java | 0 .../org/zeromq/TestRapidOpenCloseSocket.java | 0 .../org/zeromq/TestReqRouterThreadedTcp.java | 0 .../java/org/zeromq/TestSocketStreams.java | 0 .../src}/test/java/org/zeromq/TestZActor.java | 0 .../org/zeromq/TestZCancellationToken.java | 0 .../test/java/org/zeromq/TestZContext.java | 0 .../src}/test/java/org/zeromq/TestZLoop.java | 0 .../src}/test/java/org/zeromq/TestZMQ.java | 0 .../test/java/org/zeromq/TestZPoller.java | 0 .../src}/test/java/org/zeromq/TestZProxy.java | 0 .../src}/test/java/org/zeromq/TestZStar.java | 0 .../test/java/org/zeromq/TestZThread.java | 0 .../org/zeromq/TooManyOpenFilesTester.java | 0 .../test/java/org/zeromq/XpubXsubZTest.java | 0 .../test/java/org/zeromq/ZBeaconTest.java | 0 .../test/java/org/zeromq/ZCertStoreTest.java | 0 .../src}/test/java/org/zeromq/ZCertTest.java | 0 .../src}/test/java/org/zeromq/ZFrameTest.java | 0 .../src}/test/java/org/zeromq/ZLoopTest.java | 0 .../test/java/org/zeromq/ZMonitorTest.java | 0 .../src}/test/java/org/zeromq/ZMsgTest.java | 0 .../test/java/org/zeromq/ZSocketTest.java | 0 .../test/java/org/zeromq/auth/TestUtils.java | 0 .../test/java/org/zeromq/auth/ZAuthTest.java | 0 .../java/org/zeromq/auth/ZConfigTest.java | 0 .../org/zeromq/guide/AsyncServerTest.java | 0 .../java/org/zeromq/guide/EspressoTest.java | 0 .../java/org/zeromq/proto/ZNeedleTest.java | 0 .../java/org/zeromq/proto/ZPictureTest.java | 0 .../java/org/zeromq/timer/ZTickerTest.java | 0 .../java/org/zeromq/timer/ZTicketTest.java | 0 .../java/org/zeromq/timer/ZTimerTest.java | 0 .../test/java/org/zeromq/util/ZDataTest.java | 0 .../java/org/zeromq/util/ZDigestTest.java | 0 .../src}/test/java/perf/InprocLat.java | 0 .../src}/test/java/perf/LocalLat.java | 0 .../src}/test/java/perf/LocalThr.java | 0 .../src}/test/java/perf/RemoteThr.java | 0 .../src}/test/java/zmq/ConnectRidTest.java | 0 .../src}/test/java/zmq/CtxTest.java | 0 .../src}/test/java/zmq/DiffServerTest.java | 0 .../src}/test/java/zmq/HeartbeatsTest.java | 0 {src => jeromq/src}/test/java/zmq/Helper.java | 0 .../src}/test/java/zmq/ImmediateTest.java | 0 .../test/java/zmq/InprocDisconnectTest.java | 0 .../src}/test/java/zmq/InprocUnbindTest.java | 0 .../src}/test/java/zmq/OptionsTest.java | 0 .../src}/test/java/zmq/PollTest.java | 0 .../test/java/zmq/TermEndpointIpcTest.java | 0 .../src}/test/java/zmq/TestChannel.java | 0 .../src}/test/java/zmq/TestClientServer.java | 0 .../src}/test/java/zmq/TestConnectDelay.java | 0 .../test/java/zmq/TestConnectResolve.java | 0 .../src}/test/java/zmq/TestDisconnectMsg.java | 0 .../src}/test/java/zmq/TestHelloMsg.java | 0 .../src}/test/java/zmq/TestHiccupMsg.java | 0 .../src}/test/java/zmq/TestHwm.java | 0 .../src}/test/java/zmq/TestLastEndpoint.java | 0 .../src}/test/java/zmq/TestMonitor.java | 0 .../src}/test/java/zmq/TestMsg.java | 0 .../src}/test/java/zmq/TestMsgDirect.java | 0 .../src}/test/java/zmq/TestMsgFlags.java | 0 .../src}/test/java/zmq/TestPeer.java | 0 .../src}/test/java/zmq/TestRadioDish.java | 0 .../src}/test/java/zmq/TestRaw.java | 0 .../src}/test/java/zmq/TestScatterGather.java | 0 .../test/java/zmq/TestShutdownStress.java | 0 .../src}/test/java/zmq/TestSocketPoll.java | 0 .../src}/test/java/zmq/TestTermEndpoint.java | 0 .../src}/test/java/zmq/TestTimeo.java | 0 .../java/zmq/io/AbstractProtocolVersion.java | 0 .../src}/test/java/zmq/io/MetadataTest.java | 0 .../src}/test/java/zmq/io/MsgsTest.java | 0 .../test/java/zmq/io/StreamEngineTest.java | 0 .../src}/test/java/zmq/io/TimerEventTest.java | 0 .../src}/test/java/zmq/io/V0ProtocolTest.java | 0 .../src}/test/java/zmq/io/V1ProtocolTest.java | 0 .../src}/test/java/zmq/io/V2ProtocolTest.java | 0 .../zmq/io/coder/AbstractDecoderTest.java | 0 .../java/zmq/io/coder/CustomDecoderTest.java | 0 .../java/zmq/io/coder/CustomEncoderTest.java | 0 .../test/java/zmq/io/coder/V1DecoderTest.java | 0 .../test/java/zmq/io/coder/V1EncoderTest.java | 0 .../test/java/zmq/io/coder/V2DecoderTest.java | 0 .../test/java/zmq/io/coder/V2EncoderTest.java | 0 .../zmq/io/mechanism/MechanismTester.java | 0 .../zmq/io/mechanism/SecurityCurveTest.java | 0 .../zmq/io/mechanism/SecurityNullTest.java | 0 .../zmq/io/mechanism/SecurityPlainTest.java | 0 .../java/zmq/io/mechanism/ZapHandler.java | 0 .../java/zmq/io/net/BindSrcAddressTest.java | 0 .../test/java/zmq/io/net/TestAddress.java | 0 .../java/zmq/io/net/tcp/KeepAliveTest.java | 0 .../java/zmq/io/net/tcp/TcpAddressTest.java | 0 .../src}/test/java/zmq/pipe/ConflateTest.java | 0 .../src}/test/java/zmq/pipe/YQueueTest.java | 0 .../src}/test/java/zmq/poll/PollEvents.java | 0 .../test/java/zmq/poll/PollerBaseTest.java | 0 .../test/java/zmq/poll/PollerBaseTested.java | 0 .../src}/test/java/zmq/poll/PollerTest.java | 0 .../java/zmq/proxy/ProxySingleSocketTest.java | 0 .../test/java/zmq/proxy/ProxyTcpTest.java | 0 .../java/zmq/proxy/ProxyTerminateTest.java | 0 .../src}/test/java/zmq/proxy/ProxyTest.java | 0 .../java/zmq/socket/AbstractSpecTest.java | 0 .../java/zmq/socket/pair/TestPairInproc.java | 0 .../java/zmq/socket/pair/TestPairIpc.java | 0 .../java/zmq/socket/pair/TestPairTcp.java | 0 .../zmq/socket/pipeline/PushPullSpecTest.java | 0 .../zmq/socket/pipeline/TestPushPullTcp.java | 0 .../test/java/zmq/socket/pubsub/DistTest.java | 0 .../java/zmq/socket/pubsub/MTrieTest.java | 0 .../java/zmq/socket/pubsub/PubSubHwmTest.java | 0 .../test/java/zmq/socket/pubsub/PubTest.java | 0 .../test/java/zmq/socket/pubsub/SubTest.java | 0 .../java/zmq/socket/pubsub/TestPubsubTcp.java | 0 .../zmq/socket/pubsub/TestSubForward.java | 0 .../test/java/zmq/socket/pubsub/TrieTest.java | 0 .../zmq/socket/pubsub/XPubManualTest.java | 0 .../zmq/socket/pubsub/XPubNodropTest.java | 0 .../test/java/zmq/socket/pubsub/XPubTest.java | 0 .../java/zmq/socket/pubsub/XpubXsubTest.java | 0 .../zmq/socket/reqrep/DealerDealerTest.java | 0 .../zmq/socket/reqrep/DealerSpecTest.java | 0 .../java/zmq/socket/reqrep/RepSpecTest.java | 0 .../java/zmq/socket/reqrep/ReqSpecTest.java | 0 .../zmq/socket/reqrep/RouterHandoverTest.java | 0 .../socket/reqrep/RouterMandatoryTest.java | 0 .../zmq/socket/reqrep/RouterProbeTest.java | 0 .../zmq/socket/reqrep/RouterSpecTest.java | 0 .../zmq/socket/reqrep/TestInvalidRep.java | 0 .../reqrep/TestReqCorrelateRelaxed.java | 0 .../zmq/socket/reqrep/TestReqRelaxed.java | 0 .../zmq/socket/reqrep/TestReqrepDevice.java | 0 .../zmq/socket/reqrep/TestReqrepInproc.java | 0 .../java/zmq/socket/reqrep/TestReqrepIpc.java | 0 .../java/zmq/socket/reqrep/TestReqrepTcp.java | 0 .../socket/reqrep/TestRouterMandatory.java | 0 .../zmq/socket/stream/StreamEmptyTest.java | 0 .../java/zmq/socket/stream/StreamTest.java | 0 .../java/zmq/util/AndroidProblematic.java | 0 .../src}/test/java/zmq/util/MultimapTest.java | 0 .../src}/test/java/zmq/util/TestBlob.java | 0 .../src}/test/java/zmq/util/TestUtils.java | 0 .../src}/test/java/zmq/util/TimersTest.java | 0 .../src}/test/java/zmq/util/WireTest.java | 0 pom.xml | 127 ++---------------- 421 files changed, 144 insertions(+), 115 deletions(-) create mode 100644 jeromq-ipc/pom.xml rename {src/main/java16 => jeromq-ipc/src/main/java}/zmq/io/net/ipc/IpcAddress.java (100%) rename {src/main/java16 => jeromq-ipc/src/main/java}/zmq/io/net/ipc/IpcConnecter.java (100%) rename {src/main/java16 => jeromq-ipc/src/main/java}/zmq/io/net/ipc/IpcListener.java (100%) create mode 100644 jeromq/pom.xml rename {src => jeromq/src}/main/java/org/zeromq/ManagedContext.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/SocketType.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/UncheckedZMQException.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/Utils.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZActor.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZAgent.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZAuth.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZBeacon.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZCert.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZCertStore.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZConfig.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZContext.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZEvent.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZFrame.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZLoop.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZMQ.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZMQException.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZMQQueue.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZMonitor.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZMsg.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZPoller.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZProxy.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZSocket.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZStar.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZThread.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/ZTimer.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/package-info.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/proto/ZNeedle.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/proto/ZPicture.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/proto/package-info.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/timer/TimerHandler.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/timer/ZTicker.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/timer/ZTicket.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/timer/ZTimer.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/timer/package-info.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/util/ZData.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/util/ZDigest.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/util/ZMetadata.java (100%) rename {src => jeromq/src}/main/java/org/zeromq/util/package-info.java (100%) rename {src => jeromq/src}/main/java/zmq/Command.java (100%) rename {src => jeromq/src}/main/java/zmq/Config.java (100%) rename {src => jeromq/src}/main/java/zmq/Ctx.java (100%) rename {src => jeromq/src}/main/java/zmq/IMailbox.java (100%) rename {src => jeromq/src}/main/java/zmq/Mailbox.java (100%) rename {src => jeromq/src}/main/java/zmq/MailboxSafe.java (100%) rename {src => jeromq/src}/main/java/zmq/Msg.java (100%) rename {src => jeromq/src}/main/java/zmq/Options.java (100%) rename {src => jeromq/src}/main/java/zmq/Own.java (100%) rename {src => jeromq/src}/main/java/zmq/Proxy.java (100%) rename {src => jeromq/src}/main/java/zmq/Reaper.java (100%) rename {src => jeromq/src}/main/java/zmq/Signaler.java (100%) rename {src => jeromq/src}/main/java/zmq/SocketBase.java (100%) rename {src => jeromq/src}/main/java/zmq/Utils.java (100%) rename {src => jeromq/src}/main/java/zmq/ZError.java (100%) rename {src => jeromq/src}/main/java/zmq/ZMQ.java (100%) rename {src => jeromq/src}/main/java/zmq/ZObject.java (100%) rename {src => jeromq/src}/main/java/zmq/io/EngineNotImplemented.java (100%) rename {src => jeromq/src}/main/java/zmq/io/HelloMsgSession.java (100%) rename {src => jeromq/src}/main/java/zmq/io/IEngine.java (100%) rename {src => jeromq/src}/main/java/zmq/io/IOObject.java (100%) rename {src => jeromq/src}/main/java/zmq/io/IOThread.java (100%) rename {src => jeromq/src}/main/java/zmq/io/Metadata.java (100%) rename {src => jeromq/src}/main/java/zmq/io/Msgs.java (100%) rename {src => jeromq/src}/main/java/zmq/io/SessionBase.java (100%) rename {src => jeromq/src}/main/java/zmq/io/StreamEngine.java (100%) rename {src => jeromq/src}/main/java/zmq/io/coder/Decoder.java (100%) rename {src => jeromq/src}/main/java/zmq/io/coder/DecoderBase.java (100%) rename {src => jeromq/src}/main/java/zmq/io/coder/Encoder.java (100%) rename {src => jeromq/src}/main/java/zmq/io/coder/EncoderBase.java (100%) rename {src => jeromq/src}/main/java/zmq/io/coder/IDecoder.java (100%) rename {src => jeromq/src}/main/java/zmq/io/coder/IEncoder.java (100%) rename {src => jeromq/src}/main/java/zmq/io/coder/raw/RawDecoder.java (100%) rename {src => jeromq/src}/main/java/zmq/io/coder/raw/RawEncoder.java (100%) rename {src => jeromq/src}/main/java/zmq/io/coder/v1/V1Decoder.java (100%) rename {src => jeromq/src}/main/java/zmq/io/coder/v1/V1Encoder.java (100%) rename {src => jeromq/src}/main/java/zmq/io/coder/v1/V1Protocol.java (100%) rename {src => jeromq/src}/main/java/zmq/io/coder/v2/V2Decoder.java (100%) rename {src => jeromq/src}/main/java/zmq/io/coder/v2/V2Encoder.java (100%) rename {src => jeromq/src}/main/java/zmq/io/coder/v2/V2Protocol.java (100%) rename {src => jeromq/src}/main/java/zmq/io/mechanism/Mechanism.java (100%) rename {src => jeromq/src}/main/java/zmq/io/mechanism/Mechanisms.java (100%) rename {src => jeromq/src}/main/java/zmq/io/mechanism/NullMechanism.java (100%) rename {src => jeromq/src}/main/java/zmq/io/mechanism/curve/Curve.java (100%) rename {src => jeromq/src}/main/java/zmq/io/mechanism/curve/CurveClientMechanism.java (100%) rename {src => jeromq/src}/main/java/zmq/io/mechanism/curve/CurveServerMechanism.java (100%) rename {src => jeromq/src}/main/java/zmq/io/mechanism/gssapi/GssapiClientMechanism.java (100%) rename {src => jeromq/src}/main/java/zmq/io/mechanism/gssapi/GssapiServerMechanism.java (100%) rename {src => jeromq/src}/main/java/zmq/io/mechanism/plain/PlainClientMechanism.java (100%) rename {src => jeromq/src}/main/java/zmq/io/mechanism/plain/PlainServerMechanism.java (100%) rename {src => jeromq/src}/main/java/zmq/io/net/AbstractSocketConnecter.java (100%) rename {src => jeromq/src}/main/java/zmq/io/net/AbstractSocketListener.java (100%) rename {src => jeromq/src}/main/java/zmq/io/net/Address.java (100%) rename {src => jeromq/src}/main/java/zmq/io/net/Listener.java (100%) rename {src => jeromq/src}/main/java/zmq/io/net/NetProtocol.java (100%) rename {src => jeromq/src}/main/java/zmq/io/net/SelectorProviderChooser.java (100%) rename {src => jeromq/src}/main/java/zmq/io/net/ipc/IpcAddress.java (100%) rename {src => jeromq/src}/main/java/zmq/io/net/ipc/IpcConnecter.java (100%) rename {src => jeromq/src}/main/java/zmq/io/net/ipc/IpcListener.java (100%) rename {src => jeromq/src}/main/java/zmq/io/net/norm/NormEngine.java (100%) rename {src => jeromq/src}/main/java/zmq/io/net/pgm/PgmReceiver.java (100%) rename {src => jeromq/src}/main/java/zmq/io/net/pgm/PgmSender.java (100%) rename {src => jeromq/src}/main/java/zmq/io/net/tcp/SocksConnecter.java (100%) rename {src => jeromq/src}/main/java/zmq/io/net/tcp/TcpAddress.java (100%) rename {src => jeromq/src}/main/java/zmq/io/net/tcp/TcpConnecter.java (100%) rename {src => jeromq/src}/main/java/zmq/io/net/tcp/TcpListener.java (100%) rename {src => jeromq/src}/main/java/zmq/io/net/tcp/TcpUtils.java (100%) rename {src => jeromq/src}/main/java/zmq/io/net/tipc/TipcConnecter.java (100%) rename {src => jeromq/src}/main/java/zmq/io/net/tipc/TipcListener.java (100%) rename {src => jeromq/src}/main/java/zmq/msg/MsgAllocator.java (100%) rename {src => jeromq/src}/main/java/zmq/msg/MsgAllocatorDirect.java (100%) rename {src => jeromq/src}/main/java/zmq/msg/MsgAllocatorHeap.java (100%) rename {src => jeromq/src}/main/java/zmq/msg/MsgAllocatorThreshold.java (100%) rename {src => jeromq/src}/main/java/zmq/msg/package-info.java (100%) rename {src => jeromq/src}/main/java/zmq/package-info.java (100%) rename {src => jeromq/src}/main/java/zmq/pipe/DBuffer.java (100%) rename {src => jeromq/src}/main/java/zmq/pipe/Pipe.java (100%) rename {src => jeromq/src}/main/java/zmq/pipe/YPipe.java (100%) rename {src => jeromq/src}/main/java/zmq/pipe/YPipeBase.java (100%) rename {src => jeromq/src}/main/java/zmq/pipe/YPipeConflate.java (100%) rename {src => jeromq/src}/main/java/zmq/pipe/YQueue.java (100%) rename {src => jeromq/src}/main/java/zmq/poll/IPollEvents.java (100%) rename {src => jeromq/src}/main/java/zmq/poll/PollItem.java (100%) rename {src => jeromq/src}/main/java/zmq/poll/Poller.java (100%) rename {src => jeromq/src}/main/java/zmq/poll/PollerBase.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/Channel.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/FQ.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/LB.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/Pair.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/Peer.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/Raw.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/Sockets.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/Stream.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/clientserver/Client.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/clientserver/Server.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/pipeline/Pull.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/pipeline/Push.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/pubsub/Dist.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/pubsub/Mtrie.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/pubsub/Pub.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/pubsub/Sub.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/pubsub/Trie.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/pubsub/XPub.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/pubsub/XSub.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/radiodish/Dish.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/radiodish/Radio.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/reqrep/Dealer.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/reqrep/Rep.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/reqrep/Req.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/reqrep/Router.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/scattergather/Gather.java (100%) rename {src => jeromq/src}/main/java/zmq/socket/scattergather/Scatter.java (100%) rename {src => jeromq/src}/main/java/zmq/util/Blob.java (100%) rename {src => jeromq/src}/main/java/zmq/util/Clock.java (100%) rename {src => jeromq/src}/main/java/zmq/util/Draft.java (100%) rename {src => jeromq/src}/main/java/zmq/util/Errno.java (100%) rename {src => jeromq/src}/main/java/zmq/util/MultiMap.java (100%) rename {src => jeromq/src}/main/java/zmq/util/Objects.java (100%) rename {src => jeromq/src}/main/java/zmq/util/Timers.java (100%) rename {src => jeromq/src}/main/java/zmq/util/Utils.java (100%) rename {src => jeromq/src}/main/java/zmq/util/ValueReference.java (100%) rename {src => jeromq/src}/main/java/zmq/util/Wire.java (100%) rename {src => jeromq/src}/main/java/zmq/util/Z85.java (100%) rename {src => jeromq/src}/main/java/zmq/util/function/BiFunction.java (100%) rename {src => jeromq/src}/main/java/zmq/util/function/Consumer.java (100%) rename {src => jeromq/src}/main/java/zmq/util/function/Function.java (100%) rename {src => jeromq/src}/main/java/zmq/util/function/Supplier.java (100%) rename {src => jeromq/src}/test/java/guide/MDP.java (100%) rename {src => jeromq/src}/test/java/guide/ZHelper.java (100%) rename {src => jeromq/src}/test/java/guide/asyncsrv.java (100%) rename {src => jeromq/src}/test/java/guide/bstar.java (100%) rename {src => jeromq/src}/test/java/guide/bstarcli.java (100%) rename {src => jeromq/src}/test/java/guide/bstarsrv.java (100%) rename {src => jeromq/src}/test/java/guide/bstarsrv2.java (100%) rename {src => jeromq/src}/test/java/guide/clone.java (100%) rename {src => jeromq/src}/test/java/guide/clonecli1.java (100%) rename {src => jeromq/src}/test/java/guide/clonecli2.java (100%) rename {src => jeromq/src}/test/java/guide/clonecli3.java (100%) rename {src => jeromq/src}/test/java/guide/clonecli4.java (100%) rename {src => jeromq/src}/test/java/guide/clonecli5.java (100%) rename {src => jeromq/src}/test/java/guide/clonecli6.java (100%) rename {src => jeromq/src}/test/java/guide/clonesrv1.java (100%) rename {src => jeromq/src}/test/java/guide/clonesrv2.java (100%) rename {src => jeromq/src}/test/java/guide/clonesrv3.java (100%) rename {src => jeromq/src}/test/java/guide/clonesrv4.java (100%) rename {src => jeromq/src}/test/java/guide/clonesrv5.java (100%) rename {src => jeromq/src}/test/java/guide/clonesrv6.java (100%) rename {src => jeromq/src}/test/java/guide/espresso.java (100%) rename {src => jeromq/src}/test/java/guide/flcliapi.java (100%) rename {src => jeromq/src}/test/java/guide/flclient1.java (100%) rename {src => jeromq/src}/test/java/guide/flclient2.java (100%) rename {src => jeromq/src}/test/java/guide/flclient3.java (100%) rename {src => jeromq/src}/test/java/guide/flserver1.java (100%) rename {src => jeromq/src}/test/java/guide/flserver2.java (100%) rename {src => jeromq/src}/test/java/guide/flserver3.java (100%) rename {src => jeromq/src}/test/java/guide/hwclient.java (100%) rename {src => jeromq/src}/test/java/guide/hwserver.java (100%) rename {src => jeromq/src}/test/java/guide/identity.java (100%) rename {src => jeromq/src}/test/java/guide/interrupt.java (100%) rename {src => jeromq/src}/test/java/guide/kvmsg.java (100%) rename {src => jeromq/src}/test/java/guide/kvmsgTest.java (100%) rename {src => jeromq/src}/test/java/guide/kvsimple.java (100%) rename {src => jeromq/src}/test/java/guide/lbbroker.java (100%) rename {src => jeromq/src}/test/java/guide/lbbroker2.java (100%) rename {src => jeromq/src}/test/java/guide/lbbroker3.java (100%) rename {src => jeromq/src}/test/java/guide/lpclient.java (100%) rename {src => jeromq/src}/test/java/guide/lpserver.java (100%) rename {src => jeromq/src}/test/java/guide/lruqueue3.java (100%) rename {src => jeromq/src}/test/java/guide/lvcache.java (100%) rename {src => jeromq/src}/test/java/guide/mdbroker.java (100%) rename {src => jeromq/src}/test/java/guide/mdcliapi.java (100%) rename {src => jeromq/src}/test/java/guide/mdcliapi2.java (100%) rename {src => jeromq/src}/test/java/guide/mdclient.java (100%) rename {src => jeromq/src}/test/java/guide/mdclient2.java (100%) rename {src => jeromq/src}/test/java/guide/mdworker.java (100%) rename {src => jeromq/src}/test/java/guide/mdwrkapi.java (100%) rename {src => jeromq/src}/test/java/guide/mmiecho.java (100%) rename {src => jeromq/src}/test/java/guide/msgqueue.java (100%) rename {src => jeromq/src}/test/java/guide/mspoller.java (100%) rename {src => jeromq/src}/test/java/guide/msreader.java (100%) rename {src => jeromq/src}/test/java/guide/mtrelay.java (100%) rename {src => jeromq/src}/test/java/guide/mtserver.java (100%) rename {src => jeromq/src}/test/java/guide/pathopub.java (100%) rename {src => jeromq/src}/test/java/guide/pathosub.java (100%) rename {src => jeromq/src}/test/java/guide/peering1.java (100%) rename {src => jeromq/src}/test/java/guide/peering2.java (100%) rename {src => jeromq/src}/test/java/guide/peering3.java (100%) rename {src => jeromq/src}/test/java/guide/ppqueue.java (100%) rename {src => jeromq/src}/test/java/guide/ppworker.java (100%) rename {src => jeromq/src}/test/java/guide/psenvpub.java (100%) rename {src => jeromq/src}/test/java/guide/psenvsub.java (100%) rename {src => jeromq/src}/test/java/guide/rrbroker.java (100%) rename {src => jeromq/src}/test/java/guide/rrclient.java (100%) rename {src => jeromq/src}/test/java/guide/rrworker.java (100%) rename {src => jeromq/src}/test/java/guide/rtdealer.java (100%) rename {src => jeromq/src}/test/java/guide/rtmama.java (100%) rename {src => jeromq/src}/test/java/guide/rtpapa.java (100%) rename {src => jeromq/src}/test/java/guide/rtreq.java (100%) rename {src => jeromq/src}/test/java/guide/spqueue.java (100%) rename {src => jeromq/src}/test/java/guide/spworker.java (100%) rename {src => jeromq/src}/test/java/guide/suisnail.java (100%) rename {src => jeromq/src}/test/java/guide/syncpub.java (100%) rename {src => jeromq/src}/test/java/guide/syncsub.java (100%) rename {src => jeromq/src}/test/java/guide/tasksink.java (100%) rename {src => jeromq/src}/test/java/guide/tasksink2.java (100%) rename {src => jeromq/src}/test/java/guide/taskvent.java (100%) rename {src => jeromq/src}/test/java/guide/taskwork.java (100%) rename {src => jeromq/src}/test/java/guide/taskwork2.java (100%) rename {src => jeromq/src}/test/java/guide/ticlient.java (100%) rename {src => jeromq/src}/test/java/guide/titanic.java (100%) rename {src => jeromq/src}/test/java/guide/tripping.java (100%) rename {src => jeromq/src}/test/java/guide/version.java (100%) rename {src => jeromq/src}/test/java/guide/wuclient.java (100%) rename {src => jeromq/src}/test/java/guide/wuproxy.java (100%) rename {src => jeromq/src}/test/java/guide/wuserver.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/ByteBuffersTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/DealerDealerTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/HighWatermarkTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/ParanoidPiratServerWithLazyPiratClientTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/PubSubTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/PushPullTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/ReqRepTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/SelectorProviderTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TemporaryFolderFinder.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TestDisconnectInprocZeromq.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TestEventResolution.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TestEvents.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TestPoller.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TestProxy.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TestPushPullThreadedTcp.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TestRapidOpenCloseSocket.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TestReqRouterThreadedTcp.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TestSocketStreams.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TestZActor.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TestZCancellationToken.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TestZContext.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TestZLoop.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TestZMQ.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TestZPoller.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TestZProxy.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TestZStar.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TestZThread.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/TooManyOpenFilesTester.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/XpubXsubZTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/ZBeaconTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/ZCertStoreTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/ZCertTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/ZFrameTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/ZLoopTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/ZMonitorTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/ZMsgTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/ZSocketTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/auth/TestUtils.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/auth/ZAuthTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/auth/ZConfigTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/guide/AsyncServerTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/guide/EspressoTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/proto/ZNeedleTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/proto/ZPictureTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/timer/ZTickerTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/timer/ZTicketTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/timer/ZTimerTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/util/ZDataTest.java (100%) rename {src => jeromq/src}/test/java/org/zeromq/util/ZDigestTest.java (100%) rename {src => jeromq/src}/test/java/perf/InprocLat.java (100%) rename {src => jeromq/src}/test/java/perf/LocalLat.java (100%) rename {src => jeromq/src}/test/java/perf/LocalThr.java (100%) rename {src => jeromq/src}/test/java/perf/RemoteThr.java (100%) rename {src => jeromq/src}/test/java/zmq/ConnectRidTest.java (100%) rename {src => jeromq/src}/test/java/zmq/CtxTest.java (100%) rename {src => jeromq/src}/test/java/zmq/DiffServerTest.java (100%) rename {src => jeromq/src}/test/java/zmq/HeartbeatsTest.java (100%) rename {src => jeromq/src}/test/java/zmq/Helper.java (100%) rename {src => jeromq/src}/test/java/zmq/ImmediateTest.java (100%) rename {src => jeromq/src}/test/java/zmq/InprocDisconnectTest.java (100%) rename {src => jeromq/src}/test/java/zmq/InprocUnbindTest.java (100%) rename {src => jeromq/src}/test/java/zmq/OptionsTest.java (100%) rename {src => jeromq/src}/test/java/zmq/PollTest.java (100%) rename {src => jeromq/src}/test/java/zmq/TermEndpointIpcTest.java (100%) rename {src => jeromq/src}/test/java/zmq/TestChannel.java (100%) rename {src => jeromq/src}/test/java/zmq/TestClientServer.java (100%) rename {src => jeromq/src}/test/java/zmq/TestConnectDelay.java (100%) rename {src => jeromq/src}/test/java/zmq/TestConnectResolve.java (100%) rename {src => jeromq/src}/test/java/zmq/TestDisconnectMsg.java (100%) rename {src => jeromq/src}/test/java/zmq/TestHelloMsg.java (100%) rename {src => jeromq/src}/test/java/zmq/TestHiccupMsg.java (100%) rename {src => jeromq/src}/test/java/zmq/TestHwm.java (100%) rename {src => jeromq/src}/test/java/zmq/TestLastEndpoint.java (100%) rename {src => jeromq/src}/test/java/zmq/TestMonitor.java (100%) rename {src => jeromq/src}/test/java/zmq/TestMsg.java (100%) rename {src => jeromq/src}/test/java/zmq/TestMsgDirect.java (100%) rename {src => jeromq/src}/test/java/zmq/TestMsgFlags.java (100%) rename {src => jeromq/src}/test/java/zmq/TestPeer.java (100%) rename {src => jeromq/src}/test/java/zmq/TestRadioDish.java (100%) rename {src => jeromq/src}/test/java/zmq/TestRaw.java (100%) rename {src => jeromq/src}/test/java/zmq/TestScatterGather.java (100%) rename {src => jeromq/src}/test/java/zmq/TestShutdownStress.java (100%) rename {src => jeromq/src}/test/java/zmq/TestSocketPoll.java (100%) rename {src => jeromq/src}/test/java/zmq/TestTermEndpoint.java (100%) rename {src => jeromq/src}/test/java/zmq/TestTimeo.java (100%) rename {src => jeromq/src}/test/java/zmq/io/AbstractProtocolVersion.java (100%) rename {src => jeromq/src}/test/java/zmq/io/MetadataTest.java (100%) rename {src => jeromq/src}/test/java/zmq/io/MsgsTest.java (100%) rename {src => jeromq/src}/test/java/zmq/io/StreamEngineTest.java (100%) rename {src => jeromq/src}/test/java/zmq/io/TimerEventTest.java (100%) rename {src => jeromq/src}/test/java/zmq/io/V0ProtocolTest.java (100%) rename {src => jeromq/src}/test/java/zmq/io/V1ProtocolTest.java (100%) rename {src => jeromq/src}/test/java/zmq/io/V2ProtocolTest.java (100%) rename {src => jeromq/src}/test/java/zmq/io/coder/AbstractDecoderTest.java (100%) rename {src => jeromq/src}/test/java/zmq/io/coder/CustomDecoderTest.java (100%) rename {src => jeromq/src}/test/java/zmq/io/coder/CustomEncoderTest.java (100%) rename {src => jeromq/src}/test/java/zmq/io/coder/V1DecoderTest.java (100%) rename {src => jeromq/src}/test/java/zmq/io/coder/V1EncoderTest.java (100%) rename {src => jeromq/src}/test/java/zmq/io/coder/V2DecoderTest.java (100%) rename {src => jeromq/src}/test/java/zmq/io/coder/V2EncoderTest.java (100%) rename {src => jeromq/src}/test/java/zmq/io/mechanism/MechanismTester.java (100%) rename {src => jeromq/src}/test/java/zmq/io/mechanism/SecurityCurveTest.java (100%) rename {src => jeromq/src}/test/java/zmq/io/mechanism/SecurityNullTest.java (100%) rename {src => jeromq/src}/test/java/zmq/io/mechanism/SecurityPlainTest.java (100%) rename {src => jeromq/src}/test/java/zmq/io/mechanism/ZapHandler.java (100%) rename {src => jeromq/src}/test/java/zmq/io/net/BindSrcAddressTest.java (100%) rename {src => jeromq/src}/test/java/zmq/io/net/TestAddress.java (100%) rename {src => jeromq/src}/test/java/zmq/io/net/tcp/KeepAliveTest.java (100%) rename {src => jeromq/src}/test/java/zmq/io/net/tcp/TcpAddressTest.java (100%) rename {src => jeromq/src}/test/java/zmq/pipe/ConflateTest.java (100%) rename {src => jeromq/src}/test/java/zmq/pipe/YQueueTest.java (100%) rename {src => jeromq/src}/test/java/zmq/poll/PollEvents.java (100%) rename {src => jeromq/src}/test/java/zmq/poll/PollerBaseTest.java (100%) rename {src => jeromq/src}/test/java/zmq/poll/PollerBaseTested.java (100%) rename {src => jeromq/src}/test/java/zmq/poll/PollerTest.java (100%) rename {src => jeromq/src}/test/java/zmq/proxy/ProxySingleSocketTest.java (100%) rename {src => jeromq/src}/test/java/zmq/proxy/ProxyTcpTest.java (100%) rename {src => jeromq/src}/test/java/zmq/proxy/ProxyTerminateTest.java (100%) rename {src => jeromq/src}/test/java/zmq/proxy/ProxyTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/AbstractSpecTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/pair/TestPairInproc.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/pair/TestPairIpc.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/pair/TestPairTcp.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/pipeline/PushPullSpecTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/pipeline/TestPushPullTcp.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/pubsub/DistTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/pubsub/MTrieTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/pubsub/PubSubHwmTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/pubsub/PubTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/pubsub/SubTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/pubsub/TestPubsubTcp.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/pubsub/TestSubForward.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/pubsub/TrieTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/pubsub/XPubManualTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/pubsub/XPubNodropTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/pubsub/XPubTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/pubsub/XpubXsubTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/reqrep/DealerDealerTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/reqrep/DealerSpecTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/reqrep/RepSpecTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/reqrep/ReqSpecTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/reqrep/RouterHandoverTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/reqrep/RouterMandatoryTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/reqrep/RouterProbeTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/reqrep/RouterSpecTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/reqrep/TestInvalidRep.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/reqrep/TestReqCorrelateRelaxed.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/reqrep/TestReqRelaxed.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/reqrep/TestReqrepDevice.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/reqrep/TestReqrepInproc.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/reqrep/TestReqrepIpc.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/reqrep/TestReqrepTcp.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/reqrep/TestRouterMandatory.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/stream/StreamEmptyTest.java (100%) rename {src => jeromq/src}/test/java/zmq/socket/stream/StreamTest.java (100%) rename {src => jeromq/src}/test/java/zmq/util/AndroidProblematic.java (100%) rename {src => jeromq/src}/test/java/zmq/util/MultimapTest.java (100%) rename {src => jeromq/src}/test/java/zmq/util/TestBlob.java (100%) rename {src => jeromq/src}/test/java/zmq/util/TestUtils.java (100%) rename {src => jeromq/src}/test/java/zmq/util/TimersTest.java (100%) rename {src => jeromq/src}/test/java/zmq/util/WireTest.java (100%) diff --git a/jeromq-ipc/pom.xml b/jeromq-ipc/pom.xml new file mode 100644 index 000000000..07ede8340 --- /dev/null +++ b/jeromq-ipc/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + + org.zeromq + jeromq-pom + 0.6.0-SNAPSHOT + + + jeromq-ipc + + + ${project.basedir}/.. + 16 + UTF-8 + + + + + org.zeromq + jeromq + ${project.parent.version} + + + + \ No newline at end of file diff --git a/src/main/java16/zmq/io/net/ipc/IpcAddress.java b/jeromq-ipc/src/main/java/zmq/io/net/ipc/IpcAddress.java similarity index 100% rename from src/main/java16/zmq/io/net/ipc/IpcAddress.java rename to jeromq-ipc/src/main/java/zmq/io/net/ipc/IpcAddress.java diff --git a/src/main/java16/zmq/io/net/ipc/IpcConnecter.java b/jeromq-ipc/src/main/java/zmq/io/net/ipc/IpcConnecter.java similarity index 100% rename from src/main/java16/zmq/io/net/ipc/IpcConnecter.java rename to jeromq-ipc/src/main/java/zmq/io/net/ipc/IpcConnecter.java diff --git a/src/main/java16/zmq/io/net/ipc/IpcListener.java b/jeromq-ipc/src/main/java/zmq/io/net/ipc/IpcListener.java similarity index 100% rename from src/main/java16/zmq/io/net/ipc/IpcListener.java rename to jeromq-ipc/src/main/java/zmq/io/net/ipc/IpcListener.java diff --git a/jeromq/pom.xml b/jeromq/pom.xml new file mode 100644 index 000000000..94ac8398b --- /dev/null +++ b/jeromq/pom.xml @@ -0,0 +1,104 @@ + + + 4.0.0 + + org.zeromq + jeromq-pom + 0.6.0-SNAPSHOT + + + jeromq + + + ${project.basedir}/.. + 8 + + + + + junit + junit + test + + + eu.neilalexander + jnacl + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + false + 5 + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + + biz.aQute.bnd + bnd-maven-plugin + 6.4.0 + true + + + default-jar + + jar + + + + Bundle-SymbolicName: $[project.groupId].$[project.artifactId] + Export-Package: \ + zmq.*, \ + org.zeromq.* + Import-Package: \ + com.neilalexander.*;resolution:=optional, \ + * + -jpms-module-info: $[Bundle-SymbolicName];access=0 + + + + + + + org.apache.maven.plugins + maven-release-plugin + + v@{project.version} + true + false + release + deploy + + + + + \ No newline at end of file diff --git a/src/main/java/org/zeromq/ManagedContext.java b/jeromq/src/main/java/org/zeromq/ManagedContext.java similarity index 100% rename from src/main/java/org/zeromq/ManagedContext.java rename to jeromq/src/main/java/org/zeromq/ManagedContext.java diff --git a/src/main/java/org/zeromq/SocketType.java b/jeromq/src/main/java/org/zeromq/SocketType.java similarity index 100% rename from src/main/java/org/zeromq/SocketType.java rename to jeromq/src/main/java/org/zeromq/SocketType.java diff --git a/src/main/java/org/zeromq/UncheckedZMQException.java b/jeromq/src/main/java/org/zeromq/UncheckedZMQException.java similarity index 100% rename from src/main/java/org/zeromq/UncheckedZMQException.java rename to jeromq/src/main/java/org/zeromq/UncheckedZMQException.java diff --git a/src/main/java/org/zeromq/Utils.java b/jeromq/src/main/java/org/zeromq/Utils.java similarity index 100% rename from src/main/java/org/zeromq/Utils.java rename to jeromq/src/main/java/org/zeromq/Utils.java diff --git a/src/main/java/org/zeromq/ZActor.java b/jeromq/src/main/java/org/zeromq/ZActor.java similarity index 100% rename from src/main/java/org/zeromq/ZActor.java rename to jeromq/src/main/java/org/zeromq/ZActor.java diff --git a/src/main/java/org/zeromq/ZAgent.java b/jeromq/src/main/java/org/zeromq/ZAgent.java similarity index 100% rename from src/main/java/org/zeromq/ZAgent.java rename to jeromq/src/main/java/org/zeromq/ZAgent.java diff --git a/src/main/java/org/zeromq/ZAuth.java b/jeromq/src/main/java/org/zeromq/ZAuth.java similarity index 100% rename from src/main/java/org/zeromq/ZAuth.java rename to jeromq/src/main/java/org/zeromq/ZAuth.java diff --git a/src/main/java/org/zeromq/ZBeacon.java b/jeromq/src/main/java/org/zeromq/ZBeacon.java similarity index 100% rename from src/main/java/org/zeromq/ZBeacon.java rename to jeromq/src/main/java/org/zeromq/ZBeacon.java diff --git a/src/main/java/org/zeromq/ZCert.java b/jeromq/src/main/java/org/zeromq/ZCert.java similarity index 100% rename from src/main/java/org/zeromq/ZCert.java rename to jeromq/src/main/java/org/zeromq/ZCert.java diff --git a/src/main/java/org/zeromq/ZCertStore.java b/jeromq/src/main/java/org/zeromq/ZCertStore.java similarity index 100% rename from src/main/java/org/zeromq/ZCertStore.java rename to jeromq/src/main/java/org/zeromq/ZCertStore.java diff --git a/src/main/java/org/zeromq/ZConfig.java b/jeromq/src/main/java/org/zeromq/ZConfig.java similarity index 100% rename from src/main/java/org/zeromq/ZConfig.java rename to jeromq/src/main/java/org/zeromq/ZConfig.java diff --git a/src/main/java/org/zeromq/ZContext.java b/jeromq/src/main/java/org/zeromq/ZContext.java similarity index 100% rename from src/main/java/org/zeromq/ZContext.java rename to jeromq/src/main/java/org/zeromq/ZContext.java diff --git a/src/main/java/org/zeromq/ZEvent.java b/jeromq/src/main/java/org/zeromq/ZEvent.java similarity index 100% rename from src/main/java/org/zeromq/ZEvent.java rename to jeromq/src/main/java/org/zeromq/ZEvent.java diff --git a/src/main/java/org/zeromq/ZFrame.java b/jeromq/src/main/java/org/zeromq/ZFrame.java similarity index 100% rename from src/main/java/org/zeromq/ZFrame.java rename to jeromq/src/main/java/org/zeromq/ZFrame.java diff --git a/src/main/java/org/zeromq/ZLoop.java b/jeromq/src/main/java/org/zeromq/ZLoop.java similarity index 100% rename from src/main/java/org/zeromq/ZLoop.java rename to jeromq/src/main/java/org/zeromq/ZLoop.java diff --git a/src/main/java/org/zeromq/ZMQ.java b/jeromq/src/main/java/org/zeromq/ZMQ.java similarity index 100% rename from src/main/java/org/zeromq/ZMQ.java rename to jeromq/src/main/java/org/zeromq/ZMQ.java diff --git a/src/main/java/org/zeromq/ZMQException.java b/jeromq/src/main/java/org/zeromq/ZMQException.java similarity index 100% rename from src/main/java/org/zeromq/ZMQException.java rename to jeromq/src/main/java/org/zeromq/ZMQException.java diff --git a/src/main/java/org/zeromq/ZMQQueue.java b/jeromq/src/main/java/org/zeromq/ZMQQueue.java similarity index 100% rename from src/main/java/org/zeromq/ZMQQueue.java rename to jeromq/src/main/java/org/zeromq/ZMQQueue.java diff --git a/src/main/java/org/zeromq/ZMonitor.java b/jeromq/src/main/java/org/zeromq/ZMonitor.java similarity index 100% rename from src/main/java/org/zeromq/ZMonitor.java rename to jeromq/src/main/java/org/zeromq/ZMonitor.java diff --git a/src/main/java/org/zeromq/ZMsg.java b/jeromq/src/main/java/org/zeromq/ZMsg.java similarity index 100% rename from src/main/java/org/zeromq/ZMsg.java rename to jeromq/src/main/java/org/zeromq/ZMsg.java diff --git a/src/main/java/org/zeromq/ZPoller.java b/jeromq/src/main/java/org/zeromq/ZPoller.java similarity index 100% rename from src/main/java/org/zeromq/ZPoller.java rename to jeromq/src/main/java/org/zeromq/ZPoller.java diff --git a/src/main/java/org/zeromq/ZProxy.java b/jeromq/src/main/java/org/zeromq/ZProxy.java similarity index 100% rename from src/main/java/org/zeromq/ZProxy.java rename to jeromq/src/main/java/org/zeromq/ZProxy.java diff --git a/src/main/java/org/zeromq/ZSocket.java b/jeromq/src/main/java/org/zeromq/ZSocket.java similarity index 100% rename from src/main/java/org/zeromq/ZSocket.java rename to jeromq/src/main/java/org/zeromq/ZSocket.java diff --git a/src/main/java/org/zeromq/ZStar.java b/jeromq/src/main/java/org/zeromq/ZStar.java similarity index 100% rename from src/main/java/org/zeromq/ZStar.java rename to jeromq/src/main/java/org/zeromq/ZStar.java diff --git a/src/main/java/org/zeromq/ZThread.java b/jeromq/src/main/java/org/zeromq/ZThread.java similarity index 100% rename from src/main/java/org/zeromq/ZThread.java rename to jeromq/src/main/java/org/zeromq/ZThread.java diff --git a/src/main/java/org/zeromq/ZTimer.java b/jeromq/src/main/java/org/zeromq/ZTimer.java similarity index 100% rename from src/main/java/org/zeromq/ZTimer.java rename to jeromq/src/main/java/org/zeromq/ZTimer.java diff --git a/src/main/java/org/zeromq/package-info.java b/jeromq/src/main/java/org/zeromq/package-info.java similarity index 100% rename from src/main/java/org/zeromq/package-info.java rename to jeromq/src/main/java/org/zeromq/package-info.java diff --git a/src/main/java/org/zeromq/proto/ZNeedle.java b/jeromq/src/main/java/org/zeromq/proto/ZNeedle.java similarity index 100% rename from src/main/java/org/zeromq/proto/ZNeedle.java rename to jeromq/src/main/java/org/zeromq/proto/ZNeedle.java diff --git a/src/main/java/org/zeromq/proto/ZPicture.java b/jeromq/src/main/java/org/zeromq/proto/ZPicture.java similarity index 100% rename from src/main/java/org/zeromq/proto/ZPicture.java rename to jeromq/src/main/java/org/zeromq/proto/ZPicture.java diff --git a/src/main/java/org/zeromq/proto/package-info.java b/jeromq/src/main/java/org/zeromq/proto/package-info.java similarity index 100% rename from src/main/java/org/zeromq/proto/package-info.java rename to jeromq/src/main/java/org/zeromq/proto/package-info.java diff --git a/src/main/java/org/zeromq/timer/TimerHandler.java b/jeromq/src/main/java/org/zeromq/timer/TimerHandler.java similarity index 100% rename from src/main/java/org/zeromq/timer/TimerHandler.java rename to jeromq/src/main/java/org/zeromq/timer/TimerHandler.java diff --git a/src/main/java/org/zeromq/timer/ZTicker.java b/jeromq/src/main/java/org/zeromq/timer/ZTicker.java similarity index 100% rename from src/main/java/org/zeromq/timer/ZTicker.java rename to jeromq/src/main/java/org/zeromq/timer/ZTicker.java diff --git a/src/main/java/org/zeromq/timer/ZTicket.java b/jeromq/src/main/java/org/zeromq/timer/ZTicket.java similarity index 100% rename from src/main/java/org/zeromq/timer/ZTicket.java rename to jeromq/src/main/java/org/zeromq/timer/ZTicket.java diff --git a/src/main/java/org/zeromq/timer/ZTimer.java b/jeromq/src/main/java/org/zeromq/timer/ZTimer.java similarity index 100% rename from src/main/java/org/zeromq/timer/ZTimer.java rename to jeromq/src/main/java/org/zeromq/timer/ZTimer.java diff --git a/src/main/java/org/zeromq/timer/package-info.java b/jeromq/src/main/java/org/zeromq/timer/package-info.java similarity index 100% rename from src/main/java/org/zeromq/timer/package-info.java rename to jeromq/src/main/java/org/zeromq/timer/package-info.java diff --git a/src/main/java/org/zeromq/util/ZData.java b/jeromq/src/main/java/org/zeromq/util/ZData.java similarity index 100% rename from src/main/java/org/zeromq/util/ZData.java rename to jeromq/src/main/java/org/zeromq/util/ZData.java diff --git a/src/main/java/org/zeromq/util/ZDigest.java b/jeromq/src/main/java/org/zeromq/util/ZDigest.java similarity index 100% rename from src/main/java/org/zeromq/util/ZDigest.java rename to jeromq/src/main/java/org/zeromq/util/ZDigest.java diff --git a/src/main/java/org/zeromq/util/ZMetadata.java b/jeromq/src/main/java/org/zeromq/util/ZMetadata.java similarity index 100% rename from src/main/java/org/zeromq/util/ZMetadata.java rename to jeromq/src/main/java/org/zeromq/util/ZMetadata.java diff --git a/src/main/java/org/zeromq/util/package-info.java b/jeromq/src/main/java/org/zeromq/util/package-info.java similarity index 100% rename from src/main/java/org/zeromq/util/package-info.java rename to jeromq/src/main/java/org/zeromq/util/package-info.java diff --git a/src/main/java/zmq/Command.java b/jeromq/src/main/java/zmq/Command.java similarity index 100% rename from src/main/java/zmq/Command.java rename to jeromq/src/main/java/zmq/Command.java diff --git a/src/main/java/zmq/Config.java b/jeromq/src/main/java/zmq/Config.java similarity index 100% rename from src/main/java/zmq/Config.java rename to jeromq/src/main/java/zmq/Config.java diff --git a/src/main/java/zmq/Ctx.java b/jeromq/src/main/java/zmq/Ctx.java similarity index 100% rename from src/main/java/zmq/Ctx.java rename to jeromq/src/main/java/zmq/Ctx.java diff --git a/src/main/java/zmq/IMailbox.java b/jeromq/src/main/java/zmq/IMailbox.java similarity index 100% rename from src/main/java/zmq/IMailbox.java rename to jeromq/src/main/java/zmq/IMailbox.java diff --git a/src/main/java/zmq/Mailbox.java b/jeromq/src/main/java/zmq/Mailbox.java similarity index 100% rename from src/main/java/zmq/Mailbox.java rename to jeromq/src/main/java/zmq/Mailbox.java diff --git a/src/main/java/zmq/MailboxSafe.java b/jeromq/src/main/java/zmq/MailboxSafe.java similarity index 100% rename from src/main/java/zmq/MailboxSafe.java rename to jeromq/src/main/java/zmq/MailboxSafe.java diff --git a/src/main/java/zmq/Msg.java b/jeromq/src/main/java/zmq/Msg.java similarity index 100% rename from src/main/java/zmq/Msg.java rename to jeromq/src/main/java/zmq/Msg.java diff --git a/src/main/java/zmq/Options.java b/jeromq/src/main/java/zmq/Options.java similarity index 100% rename from src/main/java/zmq/Options.java rename to jeromq/src/main/java/zmq/Options.java diff --git a/src/main/java/zmq/Own.java b/jeromq/src/main/java/zmq/Own.java similarity index 100% rename from src/main/java/zmq/Own.java rename to jeromq/src/main/java/zmq/Own.java diff --git a/src/main/java/zmq/Proxy.java b/jeromq/src/main/java/zmq/Proxy.java similarity index 100% rename from src/main/java/zmq/Proxy.java rename to jeromq/src/main/java/zmq/Proxy.java diff --git a/src/main/java/zmq/Reaper.java b/jeromq/src/main/java/zmq/Reaper.java similarity index 100% rename from src/main/java/zmq/Reaper.java rename to jeromq/src/main/java/zmq/Reaper.java diff --git a/src/main/java/zmq/Signaler.java b/jeromq/src/main/java/zmq/Signaler.java similarity index 100% rename from src/main/java/zmq/Signaler.java rename to jeromq/src/main/java/zmq/Signaler.java diff --git a/src/main/java/zmq/SocketBase.java b/jeromq/src/main/java/zmq/SocketBase.java similarity index 100% rename from src/main/java/zmq/SocketBase.java rename to jeromq/src/main/java/zmq/SocketBase.java diff --git a/src/main/java/zmq/Utils.java b/jeromq/src/main/java/zmq/Utils.java similarity index 100% rename from src/main/java/zmq/Utils.java rename to jeromq/src/main/java/zmq/Utils.java diff --git a/src/main/java/zmq/ZError.java b/jeromq/src/main/java/zmq/ZError.java similarity index 100% rename from src/main/java/zmq/ZError.java rename to jeromq/src/main/java/zmq/ZError.java diff --git a/src/main/java/zmq/ZMQ.java b/jeromq/src/main/java/zmq/ZMQ.java similarity index 100% rename from src/main/java/zmq/ZMQ.java rename to jeromq/src/main/java/zmq/ZMQ.java diff --git a/src/main/java/zmq/ZObject.java b/jeromq/src/main/java/zmq/ZObject.java similarity index 100% rename from src/main/java/zmq/ZObject.java rename to jeromq/src/main/java/zmq/ZObject.java diff --git a/src/main/java/zmq/io/EngineNotImplemented.java b/jeromq/src/main/java/zmq/io/EngineNotImplemented.java similarity index 100% rename from src/main/java/zmq/io/EngineNotImplemented.java rename to jeromq/src/main/java/zmq/io/EngineNotImplemented.java diff --git a/src/main/java/zmq/io/HelloMsgSession.java b/jeromq/src/main/java/zmq/io/HelloMsgSession.java similarity index 100% rename from src/main/java/zmq/io/HelloMsgSession.java rename to jeromq/src/main/java/zmq/io/HelloMsgSession.java diff --git a/src/main/java/zmq/io/IEngine.java b/jeromq/src/main/java/zmq/io/IEngine.java similarity index 100% rename from src/main/java/zmq/io/IEngine.java rename to jeromq/src/main/java/zmq/io/IEngine.java diff --git a/src/main/java/zmq/io/IOObject.java b/jeromq/src/main/java/zmq/io/IOObject.java similarity index 100% rename from src/main/java/zmq/io/IOObject.java rename to jeromq/src/main/java/zmq/io/IOObject.java diff --git a/src/main/java/zmq/io/IOThread.java b/jeromq/src/main/java/zmq/io/IOThread.java similarity index 100% rename from src/main/java/zmq/io/IOThread.java rename to jeromq/src/main/java/zmq/io/IOThread.java diff --git a/src/main/java/zmq/io/Metadata.java b/jeromq/src/main/java/zmq/io/Metadata.java similarity index 100% rename from src/main/java/zmq/io/Metadata.java rename to jeromq/src/main/java/zmq/io/Metadata.java diff --git a/src/main/java/zmq/io/Msgs.java b/jeromq/src/main/java/zmq/io/Msgs.java similarity index 100% rename from src/main/java/zmq/io/Msgs.java rename to jeromq/src/main/java/zmq/io/Msgs.java diff --git a/src/main/java/zmq/io/SessionBase.java b/jeromq/src/main/java/zmq/io/SessionBase.java similarity index 100% rename from src/main/java/zmq/io/SessionBase.java rename to jeromq/src/main/java/zmq/io/SessionBase.java diff --git a/src/main/java/zmq/io/StreamEngine.java b/jeromq/src/main/java/zmq/io/StreamEngine.java similarity index 100% rename from src/main/java/zmq/io/StreamEngine.java rename to jeromq/src/main/java/zmq/io/StreamEngine.java diff --git a/src/main/java/zmq/io/coder/Decoder.java b/jeromq/src/main/java/zmq/io/coder/Decoder.java similarity index 100% rename from src/main/java/zmq/io/coder/Decoder.java rename to jeromq/src/main/java/zmq/io/coder/Decoder.java diff --git a/src/main/java/zmq/io/coder/DecoderBase.java b/jeromq/src/main/java/zmq/io/coder/DecoderBase.java similarity index 100% rename from src/main/java/zmq/io/coder/DecoderBase.java rename to jeromq/src/main/java/zmq/io/coder/DecoderBase.java diff --git a/src/main/java/zmq/io/coder/Encoder.java b/jeromq/src/main/java/zmq/io/coder/Encoder.java similarity index 100% rename from src/main/java/zmq/io/coder/Encoder.java rename to jeromq/src/main/java/zmq/io/coder/Encoder.java diff --git a/src/main/java/zmq/io/coder/EncoderBase.java b/jeromq/src/main/java/zmq/io/coder/EncoderBase.java similarity index 100% rename from src/main/java/zmq/io/coder/EncoderBase.java rename to jeromq/src/main/java/zmq/io/coder/EncoderBase.java diff --git a/src/main/java/zmq/io/coder/IDecoder.java b/jeromq/src/main/java/zmq/io/coder/IDecoder.java similarity index 100% rename from src/main/java/zmq/io/coder/IDecoder.java rename to jeromq/src/main/java/zmq/io/coder/IDecoder.java diff --git a/src/main/java/zmq/io/coder/IEncoder.java b/jeromq/src/main/java/zmq/io/coder/IEncoder.java similarity index 100% rename from src/main/java/zmq/io/coder/IEncoder.java rename to jeromq/src/main/java/zmq/io/coder/IEncoder.java diff --git a/src/main/java/zmq/io/coder/raw/RawDecoder.java b/jeromq/src/main/java/zmq/io/coder/raw/RawDecoder.java similarity index 100% rename from src/main/java/zmq/io/coder/raw/RawDecoder.java rename to jeromq/src/main/java/zmq/io/coder/raw/RawDecoder.java diff --git a/src/main/java/zmq/io/coder/raw/RawEncoder.java b/jeromq/src/main/java/zmq/io/coder/raw/RawEncoder.java similarity index 100% rename from src/main/java/zmq/io/coder/raw/RawEncoder.java rename to jeromq/src/main/java/zmq/io/coder/raw/RawEncoder.java diff --git a/src/main/java/zmq/io/coder/v1/V1Decoder.java b/jeromq/src/main/java/zmq/io/coder/v1/V1Decoder.java similarity index 100% rename from src/main/java/zmq/io/coder/v1/V1Decoder.java rename to jeromq/src/main/java/zmq/io/coder/v1/V1Decoder.java diff --git a/src/main/java/zmq/io/coder/v1/V1Encoder.java b/jeromq/src/main/java/zmq/io/coder/v1/V1Encoder.java similarity index 100% rename from src/main/java/zmq/io/coder/v1/V1Encoder.java rename to jeromq/src/main/java/zmq/io/coder/v1/V1Encoder.java diff --git a/src/main/java/zmq/io/coder/v1/V1Protocol.java b/jeromq/src/main/java/zmq/io/coder/v1/V1Protocol.java similarity index 100% rename from src/main/java/zmq/io/coder/v1/V1Protocol.java rename to jeromq/src/main/java/zmq/io/coder/v1/V1Protocol.java diff --git a/src/main/java/zmq/io/coder/v2/V2Decoder.java b/jeromq/src/main/java/zmq/io/coder/v2/V2Decoder.java similarity index 100% rename from src/main/java/zmq/io/coder/v2/V2Decoder.java rename to jeromq/src/main/java/zmq/io/coder/v2/V2Decoder.java diff --git a/src/main/java/zmq/io/coder/v2/V2Encoder.java b/jeromq/src/main/java/zmq/io/coder/v2/V2Encoder.java similarity index 100% rename from src/main/java/zmq/io/coder/v2/V2Encoder.java rename to jeromq/src/main/java/zmq/io/coder/v2/V2Encoder.java diff --git a/src/main/java/zmq/io/coder/v2/V2Protocol.java b/jeromq/src/main/java/zmq/io/coder/v2/V2Protocol.java similarity index 100% rename from src/main/java/zmq/io/coder/v2/V2Protocol.java rename to jeromq/src/main/java/zmq/io/coder/v2/V2Protocol.java diff --git a/src/main/java/zmq/io/mechanism/Mechanism.java b/jeromq/src/main/java/zmq/io/mechanism/Mechanism.java similarity index 100% rename from src/main/java/zmq/io/mechanism/Mechanism.java rename to jeromq/src/main/java/zmq/io/mechanism/Mechanism.java diff --git a/src/main/java/zmq/io/mechanism/Mechanisms.java b/jeromq/src/main/java/zmq/io/mechanism/Mechanisms.java similarity index 100% rename from src/main/java/zmq/io/mechanism/Mechanisms.java rename to jeromq/src/main/java/zmq/io/mechanism/Mechanisms.java diff --git a/src/main/java/zmq/io/mechanism/NullMechanism.java b/jeromq/src/main/java/zmq/io/mechanism/NullMechanism.java similarity index 100% rename from src/main/java/zmq/io/mechanism/NullMechanism.java rename to jeromq/src/main/java/zmq/io/mechanism/NullMechanism.java diff --git a/src/main/java/zmq/io/mechanism/curve/Curve.java b/jeromq/src/main/java/zmq/io/mechanism/curve/Curve.java similarity index 100% rename from src/main/java/zmq/io/mechanism/curve/Curve.java rename to jeromq/src/main/java/zmq/io/mechanism/curve/Curve.java diff --git a/src/main/java/zmq/io/mechanism/curve/CurveClientMechanism.java b/jeromq/src/main/java/zmq/io/mechanism/curve/CurveClientMechanism.java similarity index 100% rename from src/main/java/zmq/io/mechanism/curve/CurveClientMechanism.java rename to jeromq/src/main/java/zmq/io/mechanism/curve/CurveClientMechanism.java diff --git a/src/main/java/zmq/io/mechanism/curve/CurveServerMechanism.java b/jeromq/src/main/java/zmq/io/mechanism/curve/CurveServerMechanism.java similarity index 100% rename from src/main/java/zmq/io/mechanism/curve/CurveServerMechanism.java rename to jeromq/src/main/java/zmq/io/mechanism/curve/CurveServerMechanism.java diff --git a/src/main/java/zmq/io/mechanism/gssapi/GssapiClientMechanism.java b/jeromq/src/main/java/zmq/io/mechanism/gssapi/GssapiClientMechanism.java similarity index 100% rename from src/main/java/zmq/io/mechanism/gssapi/GssapiClientMechanism.java rename to jeromq/src/main/java/zmq/io/mechanism/gssapi/GssapiClientMechanism.java diff --git a/src/main/java/zmq/io/mechanism/gssapi/GssapiServerMechanism.java b/jeromq/src/main/java/zmq/io/mechanism/gssapi/GssapiServerMechanism.java similarity index 100% rename from src/main/java/zmq/io/mechanism/gssapi/GssapiServerMechanism.java rename to jeromq/src/main/java/zmq/io/mechanism/gssapi/GssapiServerMechanism.java diff --git a/src/main/java/zmq/io/mechanism/plain/PlainClientMechanism.java b/jeromq/src/main/java/zmq/io/mechanism/plain/PlainClientMechanism.java similarity index 100% rename from src/main/java/zmq/io/mechanism/plain/PlainClientMechanism.java rename to jeromq/src/main/java/zmq/io/mechanism/plain/PlainClientMechanism.java diff --git a/src/main/java/zmq/io/mechanism/plain/PlainServerMechanism.java b/jeromq/src/main/java/zmq/io/mechanism/plain/PlainServerMechanism.java similarity index 100% rename from src/main/java/zmq/io/mechanism/plain/PlainServerMechanism.java rename to jeromq/src/main/java/zmq/io/mechanism/plain/PlainServerMechanism.java diff --git a/src/main/java/zmq/io/net/AbstractSocketConnecter.java b/jeromq/src/main/java/zmq/io/net/AbstractSocketConnecter.java similarity index 100% rename from src/main/java/zmq/io/net/AbstractSocketConnecter.java rename to jeromq/src/main/java/zmq/io/net/AbstractSocketConnecter.java diff --git a/src/main/java/zmq/io/net/AbstractSocketListener.java b/jeromq/src/main/java/zmq/io/net/AbstractSocketListener.java similarity index 100% rename from src/main/java/zmq/io/net/AbstractSocketListener.java rename to jeromq/src/main/java/zmq/io/net/AbstractSocketListener.java diff --git a/src/main/java/zmq/io/net/Address.java b/jeromq/src/main/java/zmq/io/net/Address.java similarity index 100% rename from src/main/java/zmq/io/net/Address.java rename to jeromq/src/main/java/zmq/io/net/Address.java diff --git a/src/main/java/zmq/io/net/Listener.java b/jeromq/src/main/java/zmq/io/net/Listener.java similarity index 100% rename from src/main/java/zmq/io/net/Listener.java rename to jeromq/src/main/java/zmq/io/net/Listener.java diff --git a/src/main/java/zmq/io/net/NetProtocol.java b/jeromq/src/main/java/zmq/io/net/NetProtocol.java similarity index 100% rename from src/main/java/zmq/io/net/NetProtocol.java rename to jeromq/src/main/java/zmq/io/net/NetProtocol.java diff --git a/src/main/java/zmq/io/net/SelectorProviderChooser.java b/jeromq/src/main/java/zmq/io/net/SelectorProviderChooser.java similarity index 100% rename from src/main/java/zmq/io/net/SelectorProviderChooser.java rename to jeromq/src/main/java/zmq/io/net/SelectorProviderChooser.java diff --git a/src/main/java/zmq/io/net/ipc/IpcAddress.java b/jeromq/src/main/java/zmq/io/net/ipc/IpcAddress.java similarity index 100% rename from src/main/java/zmq/io/net/ipc/IpcAddress.java rename to jeromq/src/main/java/zmq/io/net/ipc/IpcAddress.java diff --git a/src/main/java/zmq/io/net/ipc/IpcConnecter.java b/jeromq/src/main/java/zmq/io/net/ipc/IpcConnecter.java similarity index 100% rename from src/main/java/zmq/io/net/ipc/IpcConnecter.java rename to jeromq/src/main/java/zmq/io/net/ipc/IpcConnecter.java diff --git a/src/main/java/zmq/io/net/ipc/IpcListener.java b/jeromq/src/main/java/zmq/io/net/ipc/IpcListener.java similarity index 100% rename from src/main/java/zmq/io/net/ipc/IpcListener.java rename to jeromq/src/main/java/zmq/io/net/ipc/IpcListener.java diff --git a/src/main/java/zmq/io/net/norm/NormEngine.java b/jeromq/src/main/java/zmq/io/net/norm/NormEngine.java similarity index 100% rename from src/main/java/zmq/io/net/norm/NormEngine.java rename to jeromq/src/main/java/zmq/io/net/norm/NormEngine.java diff --git a/src/main/java/zmq/io/net/pgm/PgmReceiver.java b/jeromq/src/main/java/zmq/io/net/pgm/PgmReceiver.java similarity index 100% rename from src/main/java/zmq/io/net/pgm/PgmReceiver.java rename to jeromq/src/main/java/zmq/io/net/pgm/PgmReceiver.java diff --git a/src/main/java/zmq/io/net/pgm/PgmSender.java b/jeromq/src/main/java/zmq/io/net/pgm/PgmSender.java similarity index 100% rename from src/main/java/zmq/io/net/pgm/PgmSender.java rename to jeromq/src/main/java/zmq/io/net/pgm/PgmSender.java diff --git a/src/main/java/zmq/io/net/tcp/SocksConnecter.java b/jeromq/src/main/java/zmq/io/net/tcp/SocksConnecter.java similarity index 100% rename from src/main/java/zmq/io/net/tcp/SocksConnecter.java rename to jeromq/src/main/java/zmq/io/net/tcp/SocksConnecter.java diff --git a/src/main/java/zmq/io/net/tcp/TcpAddress.java b/jeromq/src/main/java/zmq/io/net/tcp/TcpAddress.java similarity index 100% rename from src/main/java/zmq/io/net/tcp/TcpAddress.java rename to jeromq/src/main/java/zmq/io/net/tcp/TcpAddress.java diff --git a/src/main/java/zmq/io/net/tcp/TcpConnecter.java b/jeromq/src/main/java/zmq/io/net/tcp/TcpConnecter.java similarity index 100% rename from src/main/java/zmq/io/net/tcp/TcpConnecter.java rename to jeromq/src/main/java/zmq/io/net/tcp/TcpConnecter.java diff --git a/src/main/java/zmq/io/net/tcp/TcpListener.java b/jeromq/src/main/java/zmq/io/net/tcp/TcpListener.java similarity index 100% rename from src/main/java/zmq/io/net/tcp/TcpListener.java rename to jeromq/src/main/java/zmq/io/net/tcp/TcpListener.java diff --git a/src/main/java/zmq/io/net/tcp/TcpUtils.java b/jeromq/src/main/java/zmq/io/net/tcp/TcpUtils.java similarity index 100% rename from src/main/java/zmq/io/net/tcp/TcpUtils.java rename to jeromq/src/main/java/zmq/io/net/tcp/TcpUtils.java diff --git a/src/main/java/zmq/io/net/tipc/TipcConnecter.java b/jeromq/src/main/java/zmq/io/net/tipc/TipcConnecter.java similarity index 100% rename from src/main/java/zmq/io/net/tipc/TipcConnecter.java rename to jeromq/src/main/java/zmq/io/net/tipc/TipcConnecter.java diff --git a/src/main/java/zmq/io/net/tipc/TipcListener.java b/jeromq/src/main/java/zmq/io/net/tipc/TipcListener.java similarity index 100% rename from src/main/java/zmq/io/net/tipc/TipcListener.java rename to jeromq/src/main/java/zmq/io/net/tipc/TipcListener.java diff --git a/src/main/java/zmq/msg/MsgAllocator.java b/jeromq/src/main/java/zmq/msg/MsgAllocator.java similarity index 100% rename from src/main/java/zmq/msg/MsgAllocator.java rename to jeromq/src/main/java/zmq/msg/MsgAllocator.java diff --git a/src/main/java/zmq/msg/MsgAllocatorDirect.java b/jeromq/src/main/java/zmq/msg/MsgAllocatorDirect.java similarity index 100% rename from src/main/java/zmq/msg/MsgAllocatorDirect.java rename to jeromq/src/main/java/zmq/msg/MsgAllocatorDirect.java diff --git a/src/main/java/zmq/msg/MsgAllocatorHeap.java b/jeromq/src/main/java/zmq/msg/MsgAllocatorHeap.java similarity index 100% rename from src/main/java/zmq/msg/MsgAllocatorHeap.java rename to jeromq/src/main/java/zmq/msg/MsgAllocatorHeap.java diff --git a/src/main/java/zmq/msg/MsgAllocatorThreshold.java b/jeromq/src/main/java/zmq/msg/MsgAllocatorThreshold.java similarity index 100% rename from src/main/java/zmq/msg/MsgAllocatorThreshold.java rename to jeromq/src/main/java/zmq/msg/MsgAllocatorThreshold.java diff --git a/src/main/java/zmq/msg/package-info.java b/jeromq/src/main/java/zmq/msg/package-info.java similarity index 100% rename from src/main/java/zmq/msg/package-info.java rename to jeromq/src/main/java/zmq/msg/package-info.java diff --git a/src/main/java/zmq/package-info.java b/jeromq/src/main/java/zmq/package-info.java similarity index 100% rename from src/main/java/zmq/package-info.java rename to jeromq/src/main/java/zmq/package-info.java diff --git a/src/main/java/zmq/pipe/DBuffer.java b/jeromq/src/main/java/zmq/pipe/DBuffer.java similarity index 100% rename from src/main/java/zmq/pipe/DBuffer.java rename to jeromq/src/main/java/zmq/pipe/DBuffer.java diff --git a/src/main/java/zmq/pipe/Pipe.java b/jeromq/src/main/java/zmq/pipe/Pipe.java similarity index 100% rename from src/main/java/zmq/pipe/Pipe.java rename to jeromq/src/main/java/zmq/pipe/Pipe.java diff --git a/src/main/java/zmq/pipe/YPipe.java b/jeromq/src/main/java/zmq/pipe/YPipe.java similarity index 100% rename from src/main/java/zmq/pipe/YPipe.java rename to jeromq/src/main/java/zmq/pipe/YPipe.java diff --git a/src/main/java/zmq/pipe/YPipeBase.java b/jeromq/src/main/java/zmq/pipe/YPipeBase.java similarity index 100% rename from src/main/java/zmq/pipe/YPipeBase.java rename to jeromq/src/main/java/zmq/pipe/YPipeBase.java diff --git a/src/main/java/zmq/pipe/YPipeConflate.java b/jeromq/src/main/java/zmq/pipe/YPipeConflate.java similarity index 100% rename from src/main/java/zmq/pipe/YPipeConflate.java rename to jeromq/src/main/java/zmq/pipe/YPipeConflate.java diff --git a/src/main/java/zmq/pipe/YQueue.java b/jeromq/src/main/java/zmq/pipe/YQueue.java similarity index 100% rename from src/main/java/zmq/pipe/YQueue.java rename to jeromq/src/main/java/zmq/pipe/YQueue.java diff --git a/src/main/java/zmq/poll/IPollEvents.java b/jeromq/src/main/java/zmq/poll/IPollEvents.java similarity index 100% rename from src/main/java/zmq/poll/IPollEvents.java rename to jeromq/src/main/java/zmq/poll/IPollEvents.java diff --git a/src/main/java/zmq/poll/PollItem.java b/jeromq/src/main/java/zmq/poll/PollItem.java similarity index 100% rename from src/main/java/zmq/poll/PollItem.java rename to jeromq/src/main/java/zmq/poll/PollItem.java diff --git a/src/main/java/zmq/poll/Poller.java b/jeromq/src/main/java/zmq/poll/Poller.java similarity index 100% rename from src/main/java/zmq/poll/Poller.java rename to jeromq/src/main/java/zmq/poll/Poller.java diff --git a/src/main/java/zmq/poll/PollerBase.java b/jeromq/src/main/java/zmq/poll/PollerBase.java similarity index 100% rename from src/main/java/zmq/poll/PollerBase.java rename to jeromq/src/main/java/zmq/poll/PollerBase.java diff --git a/src/main/java/zmq/socket/Channel.java b/jeromq/src/main/java/zmq/socket/Channel.java similarity index 100% rename from src/main/java/zmq/socket/Channel.java rename to jeromq/src/main/java/zmq/socket/Channel.java diff --git a/src/main/java/zmq/socket/FQ.java b/jeromq/src/main/java/zmq/socket/FQ.java similarity index 100% rename from src/main/java/zmq/socket/FQ.java rename to jeromq/src/main/java/zmq/socket/FQ.java diff --git a/src/main/java/zmq/socket/LB.java b/jeromq/src/main/java/zmq/socket/LB.java similarity index 100% rename from src/main/java/zmq/socket/LB.java rename to jeromq/src/main/java/zmq/socket/LB.java diff --git a/src/main/java/zmq/socket/Pair.java b/jeromq/src/main/java/zmq/socket/Pair.java similarity index 100% rename from src/main/java/zmq/socket/Pair.java rename to jeromq/src/main/java/zmq/socket/Pair.java diff --git a/src/main/java/zmq/socket/Peer.java b/jeromq/src/main/java/zmq/socket/Peer.java similarity index 100% rename from src/main/java/zmq/socket/Peer.java rename to jeromq/src/main/java/zmq/socket/Peer.java diff --git a/src/main/java/zmq/socket/Raw.java b/jeromq/src/main/java/zmq/socket/Raw.java similarity index 100% rename from src/main/java/zmq/socket/Raw.java rename to jeromq/src/main/java/zmq/socket/Raw.java diff --git a/src/main/java/zmq/socket/Sockets.java b/jeromq/src/main/java/zmq/socket/Sockets.java similarity index 100% rename from src/main/java/zmq/socket/Sockets.java rename to jeromq/src/main/java/zmq/socket/Sockets.java diff --git a/src/main/java/zmq/socket/Stream.java b/jeromq/src/main/java/zmq/socket/Stream.java similarity index 100% rename from src/main/java/zmq/socket/Stream.java rename to jeromq/src/main/java/zmq/socket/Stream.java diff --git a/src/main/java/zmq/socket/clientserver/Client.java b/jeromq/src/main/java/zmq/socket/clientserver/Client.java similarity index 100% rename from src/main/java/zmq/socket/clientserver/Client.java rename to jeromq/src/main/java/zmq/socket/clientserver/Client.java diff --git a/src/main/java/zmq/socket/clientserver/Server.java b/jeromq/src/main/java/zmq/socket/clientserver/Server.java similarity index 100% rename from src/main/java/zmq/socket/clientserver/Server.java rename to jeromq/src/main/java/zmq/socket/clientserver/Server.java diff --git a/src/main/java/zmq/socket/pipeline/Pull.java b/jeromq/src/main/java/zmq/socket/pipeline/Pull.java similarity index 100% rename from src/main/java/zmq/socket/pipeline/Pull.java rename to jeromq/src/main/java/zmq/socket/pipeline/Pull.java diff --git a/src/main/java/zmq/socket/pipeline/Push.java b/jeromq/src/main/java/zmq/socket/pipeline/Push.java similarity index 100% rename from src/main/java/zmq/socket/pipeline/Push.java rename to jeromq/src/main/java/zmq/socket/pipeline/Push.java diff --git a/src/main/java/zmq/socket/pubsub/Dist.java b/jeromq/src/main/java/zmq/socket/pubsub/Dist.java similarity index 100% rename from src/main/java/zmq/socket/pubsub/Dist.java rename to jeromq/src/main/java/zmq/socket/pubsub/Dist.java diff --git a/src/main/java/zmq/socket/pubsub/Mtrie.java b/jeromq/src/main/java/zmq/socket/pubsub/Mtrie.java similarity index 100% rename from src/main/java/zmq/socket/pubsub/Mtrie.java rename to jeromq/src/main/java/zmq/socket/pubsub/Mtrie.java diff --git a/src/main/java/zmq/socket/pubsub/Pub.java b/jeromq/src/main/java/zmq/socket/pubsub/Pub.java similarity index 100% rename from src/main/java/zmq/socket/pubsub/Pub.java rename to jeromq/src/main/java/zmq/socket/pubsub/Pub.java diff --git a/src/main/java/zmq/socket/pubsub/Sub.java b/jeromq/src/main/java/zmq/socket/pubsub/Sub.java similarity index 100% rename from src/main/java/zmq/socket/pubsub/Sub.java rename to jeromq/src/main/java/zmq/socket/pubsub/Sub.java diff --git a/src/main/java/zmq/socket/pubsub/Trie.java b/jeromq/src/main/java/zmq/socket/pubsub/Trie.java similarity index 100% rename from src/main/java/zmq/socket/pubsub/Trie.java rename to jeromq/src/main/java/zmq/socket/pubsub/Trie.java diff --git a/src/main/java/zmq/socket/pubsub/XPub.java b/jeromq/src/main/java/zmq/socket/pubsub/XPub.java similarity index 100% rename from src/main/java/zmq/socket/pubsub/XPub.java rename to jeromq/src/main/java/zmq/socket/pubsub/XPub.java diff --git a/src/main/java/zmq/socket/pubsub/XSub.java b/jeromq/src/main/java/zmq/socket/pubsub/XSub.java similarity index 100% rename from src/main/java/zmq/socket/pubsub/XSub.java rename to jeromq/src/main/java/zmq/socket/pubsub/XSub.java diff --git a/src/main/java/zmq/socket/radiodish/Dish.java b/jeromq/src/main/java/zmq/socket/radiodish/Dish.java similarity index 100% rename from src/main/java/zmq/socket/radiodish/Dish.java rename to jeromq/src/main/java/zmq/socket/radiodish/Dish.java diff --git a/src/main/java/zmq/socket/radiodish/Radio.java b/jeromq/src/main/java/zmq/socket/radiodish/Radio.java similarity index 100% rename from src/main/java/zmq/socket/radiodish/Radio.java rename to jeromq/src/main/java/zmq/socket/radiodish/Radio.java diff --git a/src/main/java/zmq/socket/reqrep/Dealer.java b/jeromq/src/main/java/zmq/socket/reqrep/Dealer.java similarity index 100% rename from src/main/java/zmq/socket/reqrep/Dealer.java rename to jeromq/src/main/java/zmq/socket/reqrep/Dealer.java diff --git a/src/main/java/zmq/socket/reqrep/Rep.java b/jeromq/src/main/java/zmq/socket/reqrep/Rep.java similarity index 100% rename from src/main/java/zmq/socket/reqrep/Rep.java rename to jeromq/src/main/java/zmq/socket/reqrep/Rep.java diff --git a/src/main/java/zmq/socket/reqrep/Req.java b/jeromq/src/main/java/zmq/socket/reqrep/Req.java similarity index 100% rename from src/main/java/zmq/socket/reqrep/Req.java rename to jeromq/src/main/java/zmq/socket/reqrep/Req.java diff --git a/src/main/java/zmq/socket/reqrep/Router.java b/jeromq/src/main/java/zmq/socket/reqrep/Router.java similarity index 100% rename from src/main/java/zmq/socket/reqrep/Router.java rename to jeromq/src/main/java/zmq/socket/reqrep/Router.java diff --git a/src/main/java/zmq/socket/scattergather/Gather.java b/jeromq/src/main/java/zmq/socket/scattergather/Gather.java similarity index 100% rename from src/main/java/zmq/socket/scattergather/Gather.java rename to jeromq/src/main/java/zmq/socket/scattergather/Gather.java diff --git a/src/main/java/zmq/socket/scattergather/Scatter.java b/jeromq/src/main/java/zmq/socket/scattergather/Scatter.java similarity index 100% rename from src/main/java/zmq/socket/scattergather/Scatter.java rename to jeromq/src/main/java/zmq/socket/scattergather/Scatter.java diff --git a/src/main/java/zmq/util/Blob.java b/jeromq/src/main/java/zmq/util/Blob.java similarity index 100% rename from src/main/java/zmq/util/Blob.java rename to jeromq/src/main/java/zmq/util/Blob.java diff --git a/src/main/java/zmq/util/Clock.java b/jeromq/src/main/java/zmq/util/Clock.java similarity index 100% rename from src/main/java/zmq/util/Clock.java rename to jeromq/src/main/java/zmq/util/Clock.java diff --git a/src/main/java/zmq/util/Draft.java b/jeromq/src/main/java/zmq/util/Draft.java similarity index 100% rename from src/main/java/zmq/util/Draft.java rename to jeromq/src/main/java/zmq/util/Draft.java diff --git a/src/main/java/zmq/util/Errno.java b/jeromq/src/main/java/zmq/util/Errno.java similarity index 100% rename from src/main/java/zmq/util/Errno.java rename to jeromq/src/main/java/zmq/util/Errno.java diff --git a/src/main/java/zmq/util/MultiMap.java b/jeromq/src/main/java/zmq/util/MultiMap.java similarity index 100% rename from src/main/java/zmq/util/MultiMap.java rename to jeromq/src/main/java/zmq/util/MultiMap.java diff --git a/src/main/java/zmq/util/Objects.java b/jeromq/src/main/java/zmq/util/Objects.java similarity index 100% rename from src/main/java/zmq/util/Objects.java rename to jeromq/src/main/java/zmq/util/Objects.java diff --git a/src/main/java/zmq/util/Timers.java b/jeromq/src/main/java/zmq/util/Timers.java similarity index 100% rename from src/main/java/zmq/util/Timers.java rename to jeromq/src/main/java/zmq/util/Timers.java diff --git a/src/main/java/zmq/util/Utils.java b/jeromq/src/main/java/zmq/util/Utils.java similarity index 100% rename from src/main/java/zmq/util/Utils.java rename to jeromq/src/main/java/zmq/util/Utils.java diff --git a/src/main/java/zmq/util/ValueReference.java b/jeromq/src/main/java/zmq/util/ValueReference.java similarity index 100% rename from src/main/java/zmq/util/ValueReference.java rename to jeromq/src/main/java/zmq/util/ValueReference.java diff --git a/src/main/java/zmq/util/Wire.java b/jeromq/src/main/java/zmq/util/Wire.java similarity index 100% rename from src/main/java/zmq/util/Wire.java rename to jeromq/src/main/java/zmq/util/Wire.java diff --git a/src/main/java/zmq/util/Z85.java b/jeromq/src/main/java/zmq/util/Z85.java similarity index 100% rename from src/main/java/zmq/util/Z85.java rename to jeromq/src/main/java/zmq/util/Z85.java diff --git a/src/main/java/zmq/util/function/BiFunction.java b/jeromq/src/main/java/zmq/util/function/BiFunction.java similarity index 100% rename from src/main/java/zmq/util/function/BiFunction.java rename to jeromq/src/main/java/zmq/util/function/BiFunction.java diff --git a/src/main/java/zmq/util/function/Consumer.java b/jeromq/src/main/java/zmq/util/function/Consumer.java similarity index 100% rename from src/main/java/zmq/util/function/Consumer.java rename to jeromq/src/main/java/zmq/util/function/Consumer.java diff --git a/src/main/java/zmq/util/function/Function.java b/jeromq/src/main/java/zmq/util/function/Function.java similarity index 100% rename from src/main/java/zmq/util/function/Function.java rename to jeromq/src/main/java/zmq/util/function/Function.java diff --git a/src/main/java/zmq/util/function/Supplier.java b/jeromq/src/main/java/zmq/util/function/Supplier.java similarity index 100% rename from src/main/java/zmq/util/function/Supplier.java rename to jeromq/src/main/java/zmq/util/function/Supplier.java diff --git a/src/test/java/guide/MDP.java b/jeromq/src/test/java/guide/MDP.java similarity index 100% rename from src/test/java/guide/MDP.java rename to jeromq/src/test/java/guide/MDP.java diff --git a/src/test/java/guide/ZHelper.java b/jeromq/src/test/java/guide/ZHelper.java similarity index 100% rename from src/test/java/guide/ZHelper.java rename to jeromq/src/test/java/guide/ZHelper.java diff --git a/src/test/java/guide/asyncsrv.java b/jeromq/src/test/java/guide/asyncsrv.java similarity index 100% rename from src/test/java/guide/asyncsrv.java rename to jeromq/src/test/java/guide/asyncsrv.java diff --git a/src/test/java/guide/bstar.java b/jeromq/src/test/java/guide/bstar.java similarity index 100% rename from src/test/java/guide/bstar.java rename to jeromq/src/test/java/guide/bstar.java diff --git a/src/test/java/guide/bstarcli.java b/jeromq/src/test/java/guide/bstarcli.java similarity index 100% rename from src/test/java/guide/bstarcli.java rename to jeromq/src/test/java/guide/bstarcli.java diff --git a/src/test/java/guide/bstarsrv.java b/jeromq/src/test/java/guide/bstarsrv.java similarity index 100% rename from src/test/java/guide/bstarsrv.java rename to jeromq/src/test/java/guide/bstarsrv.java diff --git a/src/test/java/guide/bstarsrv2.java b/jeromq/src/test/java/guide/bstarsrv2.java similarity index 100% rename from src/test/java/guide/bstarsrv2.java rename to jeromq/src/test/java/guide/bstarsrv2.java diff --git a/src/test/java/guide/clone.java b/jeromq/src/test/java/guide/clone.java similarity index 100% rename from src/test/java/guide/clone.java rename to jeromq/src/test/java/guide/clone.java diff --git a/src/test/java/guide/clonecli1.java b/jeromq/src/test/java/guide/clonecli1.java similarity index 100% rename from src/test/java/guide/clonecli1.java rename to jeromq/src/test/java/guide/clonecli1.java diff --git a/src/test/java/guide/clonecli2.java b/jeromq/src/test/java/guide/clonecli2.java similarity index 100% rename from src/test/java/guide/clonecli2.java rename to jeromq/src/test/java/guide/clonecli2.java diff --git a/src/test/java/guide/clonecli3.java b/jeromq/src/test/java/guide/clonecli3.java similarity index 100% rename from src/test/java/guide/clonecli3.java rename to jeromq/src/test/java/guide/clonecli3.java diff --git a/src/test/java/guide/clonecli4.java b/jeromq/src/test/java/guide/clonecli4.java similarity index 100% rename from src/test/java/guide/clonecli4.java rename to jeromq/src/test/java/guide/clonecli4.java diff --git a/src/test/java/guide/clonecli5.java b/jeromq/src/test/java/guide/clonecli5.java similarity index 100% rename from src/test/java/guide/clonecli5.java rename to jeromq/src/test/java/guide/clonecli5.java diff --git a/src/test/java/guide/clonecli6.java b/jeromq/src/test/java/guide/clonecli6.java similarity index 100% rename from src/test/java/guide/clonecli6.java rename to jeromq/src/test/java/guide/clonecli6.java diff --git a/src/test/java/guide/clonesrv1.java b/jeromq/src/test/java/guide/clonesrv1.java similarity index 100% rename from src/test/java/guide/clonesrv1.java rename to jeromq/src/test/java/guide/clonesrv1.java diff --git a/src/test/java/guide/clonesrv2.java b/jeromq/src/test/java/guide/clonesrv2.java similarity index 100% rename from src/test/java/guide/clonesrv2.java rename to jeromq/src/test/java/guide/clonesrv2.java diff --git a/src/test/java/guide/clonesrv3.java b/jeromq/src/test/java/guide/clonesrv3.java similarity index 100% rename from src/test/java/guide/clonesrv3.java rename to jeromq/src/test/java/guide/clonesrv3.java diff --git a/src/test/java/guide/clonesrv4.java b/jeromq/src/test/java/guide/clonesrv4.java similarity index 100% rename from src/test/java/guide/clonesrv4.java rename to jeromq/src/test/java/guide/clonesrv4.java diff --git a/src/test/java/guide/clonesrv5.java b/jeromq/src/test/java/guide/clonesrv5.java similarity index 100% rename from src/test/java/guide/clonesrv5.java rename to jeromq/src/test/java/guide/clonesrv5.java diff --git a/src/test/java/guide/clonesrv6.java b/jeromq/src/test/java/guide/clonesrv6.java similarity index 100% rename from src/test/java/guide/clonesrv6.java rename to jeromq/src/test/java/guide/clonesrv6.java diff --git a/src/test/java/guide/espresso.java b/jeromq/src/test/java/guide/espresso.java similarity index 100% rename from src/test/java/guide/espresso.java rename to jeromq/src/test/java/guide/espresso.java diff --git a/src/test/java/guide/flcliapi.java b/jeromq/src/test/java/guide/flcliapi.java similarity index 100% rename from src/test/java/guide/flcliapi.java rename to jeromq/src/test/java/guide/flcliapi.java diff --git a/src/test/java/guide/flclient1.java b/jeromq/src/test/java/guide/flclient1.java similarity index 100% rename from src/test/java/guide/flclient1.java rename to jeromq/src/test/java/guide/flclient1.java diff --git a/src/test/java/guide/flclient2.java b/jeromq/src/test/java/guide/flclient2.java similarity index 100% rename from src/test/java/guide/flclient2.java rename to jeromq/src/test/java/guide/flclient2.java diff --git a/src/test/java/guide/flclient3.java b/jeromq/src/test/java/guide/flclient3.java similarity index 100% rename from src/test/java/guide/flclient3.java rename to jeromq/src/test/java/guide/flclient3.java diff --git a/src/test/java/guide/flserver1.java b/jeromq/src/test/java/guide/flserver1.java similarity index 100% rename from src/test/java/guide/flserver1.java rename to jeromq/src/test/java/guide/flserver1.java diff --git a/src/test/java/guide/flserver2.java b/jeromq/src/test/java/guide/flserver2.java similarity index 100% rename from src/test/java/guide/flserver2.java rename to jeromq/src/test/java/guide/flserver2.java diff --git a/src/test/java/guide/flserver3.java b/jeromq/src/test/java/guide/flserver3.java similarity index 100% rename from src/test/java/guide/flserver3.java rename to jeromq/src/test/java/guide/flserver3.java diff --git a/src/test/java/guide/hwclient.java b/jeromq/src/test/java/guide/hwclient.java similarity index 100% rename from src/test/java/guide/hwclient.java rename to jeromq/src/test/java/guide/hwclient.java diff --git a/src/test/java/guide/hwserver.java b/jeromq/src/test/java/guide/hwserver.java similarity index 100% rename from src/test/java/guide/hwserver.java rename to jeromq/src/test/java/guide/hwserver.java diff --git a/src/test/java/guide/identity.java b/jeromq/src/test/java/guide/identity.java similarity index 100% rename from src/test/java/guide/identity.java rename to jeromq/src/test/java/guide/identity.java diff --git a/src/test/java/guide/interrupt.java b/jeromq/src/test/java/guide/interrupt.java similarity index 100% rename from src/test/java/guide/interrupt.java rename to jeromq/src/test/java/guide/interrupt.java diff --git a/src/test/java/guide/kvmsg.java b/jeromq/src/test/java/guide/kvmsg.java similarity index 100% rename from src/test/java/guide/kvmsg.java rename to jeromq/src/test/java/guide/kvmsg.java diff --git a/src/test/java/guide/kvmsgTest.java b/jeromq/src/test/java/guide/kvmsgTest.java similarity index 100% rename from src/test/java/guide/kvmsgTest.java rename to jeromq/src/test/java/guide/kvmsgTest.java diff --git a/src/test/java/guide/kvsimple.java b/jeromq/src/test/java/guide/kvsimple.java similarity index 100% rename from src/test/java/guide/kvsimple.java rename to jeromq/src/test/java/guide/kvsimple.java diff --git a/src/test/java/guide/lbbroker.java b/jeromq/src/test/java/guide/lbbroker.java similarity index 100% rename from src/test/java/guide/lbbroker.java rename to jeromq/src/test/java/guide/lbbroker.java diff --git a/src/test/java/guide/lbbroker2.java b/jeromq/src/test/java/guide/lbbroker2.java similarity index 100% rename from src/test/java/guide/lbbroker2.java rename to jeromq/src/test/java/guide/lbbroker2.java diff --git a/src/test/java/guide/lbbroker3.java b/jeromq/src/test/java/guide/lbbroker3.java similarity index 100% rename from src/test/java/guide/lbbroker3.java rename to jeromq/src/test/java/guide/lbbroker3.java diff --git a/src/test/java/guide/lpclient.java b/jeromq/src/test/java/guide/lpclient.java similarity index 100% rename from src/test/java/guide/lpclient.java rename to jeromq/src/test/java/guide/lpclient.java diff --git a/src/test/java/guide/lpserver.java b/jeromq/src/test/java/guide/lpserver.java similarity index 100% rename from src/test/java/guide/lpserver.java rename to jeromq/src/test/java/guide/lpserver.java diff --git a/src/test/java/guide/lruqueue3.java b/jeromq/src/test/java/guide/lruqueue3.java similarity index 100% rename from src/test/java/guide/lruqueue3.java rename to jeromq/src/test/java/guide/lruqueue3.java diff --git a/src/test/java/guide/lvcache.java b/jeromq/src/test/java/guide/lvcache.java similarity index 100% rename from src/test/java/guide/lvcache.java rename to jeromq/src/test/java/guide/lvcache.java diff --git a/src/test/java/guide/mdbroker.java b/jeromq/src/test/java/guide/mdbroker.java similarity index 100% rename from src/test/java/guide/mdbroker.java rename to jeromq/src/test/java/guide/mdbroker.java diff --git a/src/test/java/guide/mdcliapi.java b/jeromq/src/test/java/guide/mdcliapi.java similarity index 100% rename from src/test/java/guide/mdcliapi.java rename to jeromq/src/test/java/guide/mdcliapi.java diff --git a/src/test/java/guide/mdcliapi2.java b/jeromq/src/test/java/guide/mdcliapi2.java similarity index 100% rename from src/test/java/guide/mdcliapi2.java rename to jeromq/src/test/java/guide/mdcliapi2.java diff --git a/src/test/java/guide/mdclient.java b/jeromq/src/test/java/guide/mdclient.java similarity index 100% rename from src/test/java/guide/mdclient.java rename to jeromq/src/test/java/guide/mdclient.java diff --git a/src/test/java/guide/mdclient2.java b/jeromq/src/test/java/guide/mdclient2.java similarity index 100% rename from src/test/java/guide/mdclient2.java rename to jeromq/src/test/java/guide/mdclient2.java diff --git a/src/test/java/guide/mdworker.java b/jeromq/src/test/java/guide/mdworker.java similarity index 100% rename from src/test/java/guide/mdworker.java rename to jeromq/src/test/java/guide/mdworker.java diff --git a/src/test/java/guide/mdwrkapi.java b/jeromq/src/test/java/guide/mdwrkapi.java similarity index 100% rename from src/test/java/guide/mdwrkapi.java rename to jeromq/src/test/java/guide/mdwrkapi.java diff --git a/src/test/java/guide/mmiecho.java b/jeromq/src/test/java/guide/mmiecho.java similarity index 100% rename from src/test/java/guide/mmiecho.java rename to jeromq/src/test/java/guide/mmiecho.java diff --git a/src/test/java/guide/msgqueue.java b/jeromq/src/test/java/guide/msgqueue.java similarity index 100% rename from src/test/java/guide/msgqueue.java rename to jeromq/src/test/java/guide/msgqueue.java diff --git a/src/test/java/guide/mspoller.java b/jeromq/src/test/java/guide/mspoller.java similarity index 100% rename from src/test/java/guide/mspoller.java rename to jeromq/src/test/java/guide/mspoller.java diff --git a/src/test/java/guide/msreader.java b/jeromq/src/test/java/guide/msreader.java similarity index 100% rename from src/test/java/guide/msreader.java rename to jeromq/src/test/java/guide/msreader.java diff --git a/src/test/java/guide/mtrelay.java b/jeromq/src/test/java/guide/mtrelay.java similarity index 100% rename from src/test/java/guide/mtrelay.java rename to jeromq/src/test/java/guide/mtrelay.java diff --git a/src/test/java/guide/mtserver.java b/jeromq/src/test/java/guide/mtserver.java similarity index 100% rename from src/test/java/guide/mtserver.java rename to jeromq/src/test/java/guide/mtserver.java diff --git a/src/test/java/guide/pathopub.java b/jeromq/src/test/java/guide/pathopub.java similarity index 100% rename from src/test/java/guide/pathopub.java rename to jeromq/src/test/java/guide/pathopub.java diff --git a/src/test/java/guide/pathosub.java b/jeromq/src/test/java/guide/pathosub.java similarity index 100% rename from src/test/java/guide/pathosub.java rename to jeromq/src/test/java/guide/pathosub.java diff --git a/src/test/java/guide/peering1.java b/jeromq/src/test/java/guide/peering1.java similarity index 100% rename from src/test/java/guide/peering1.java rename to jeromq/src/test/java/guide/peering1.java diff --git a/src/test/java/guide/peering2.java b/jeromq/src/test/java/guide/peering2.java similarity index 100% rename from src/test/java/guide/peering2.java rename to jeromq/src/test/java/guide/peering2.java diff --git a/src/test/java/guide/peering3.java b/jeromq/src/test/java/guide/peering3.java similarity index 100% rename from src/test/java/guide/peering3.java rename to jeromq/src/test/java/guide/peering3.java diff --git a/src/test/java/guide/ppqueue.java b/jeromq/src/test/java/guide/ppqueue.java similarity index 100% rename from src/test/java/guide/ppqueue.java rename to jeromq/src/test/java/guide/ppqueue.java diff --git a/src/test/java/guide/ppworker.java b/jeromq/src/test/java/guide/ppworker.java similarity index 100% rename from src/test/java/guide/ppworker.java rename to jeromq/src/test/java/guide/ppworker.java diff --git a/src/test/java/guide/psenvpub.java b/jeromq/src/test/java/guide/psenvpub.java similarity index 100% rename from src/test/java/guide/psenvpub.java rename to jeromq/src/test/java/guide/psenvpub.java diff --git a/src/test/java/guide/psenvsub.java b/jeromq/src/test/java/guide/psenvsub.java similarity index 100% rename from src/test/java/guide/psenvsub.java rename to jeromq/src/test/java/guide/psenvsub.java diff --git a/src/test/java/guide/rrbroker.java b/jeromq/src/test/java/guide/rrbroker.java similarity index 100% rename from src/test/java/guide/rrbroker.java rename to jeromq/src/test/java/guide/rrbroker.java diff --git a/src/test/java/guide/rrclient.java b/jeromq/src/test/java/guide/rrclient.java similarity index 100% rename from src/test/java/guide/rrclient.java rename to jeromq/src/test/java/guide/rrclient.java diff --git a/src/test/java/guide/rrworker.java b/jeromq/src/test/java/guide/rrworker.java similarity index 100% rename from src/test/java/guide/rrworker.java rename to jeromq/src/test/java/guide/rrworker.java diff --git a/src/test/java/guide/rtdealer.java b/jeromq/src/test/java/guide/rtdealer.java similarity index 100% rename from src/test/java/guide/rtdealer.java rename to jeromq/src/test/java/guide/rtdealer.java diff --git a/src/test/java/guide/rtmama.java b/jeromq/src/test/java/guide/rtmama.java similarity index 100% rename from src/test/java/guide/rtmama.java rename to jeromq/src/test/java/guide/rtmama.java diff --git a/src/test/java/guide/rtpapa.java b/jeromq/src/test/java/guide/rtpapa.java similarity index 100% rename from src/test/java/guide/rtpapa.java rename to jeromq/src/test/java/guide/rtpapa.java diff --git a/src/test/java/guide/rtreq.java b/jeromq/src/test/java/guide/rtreq.java similarity index 100% rename from src/test/java/guide/rtreq.java rename to jeromq/src/test/java/guide/rtreq.java diff --git a/src/test/java/guide/spqueue.java b/jeromq/src/test/java/guide/spqueue.java similarity index 100% rename from src/test/java/guide/spqueue.java rename to jeromq/src/test/java/guide/spqueue.java diff --git a/src/test/java/guide/spworker.java b/jeromq/src/test/java/guide/spworker.java similarity index 100% rename from src/test/java/guide/spworker.java rename to jeromq/src/test/java/guide/spworker.java diff --git a/src/test/java/guide/suisnail.java b/jeromq/src/test/java/guide/suisnail.java similarity index 100% rename from src/test/java/guide/suisnail.java rename to jeromq/src/test/java/guide/suisnail.java diff --git a/src/test/java/guide/syncpub.java b/jeromq/src/test/java/guide/syncpub.java similarity index 100% rename from src/test/java/guide/syncpub.java rename to jeromq/src/test/java/guide/syncpub.java diff --git a/src/test/java/guide/syncsub.java b/jeromq/src/test/java/guide/syncsub.java similarity index 100% rename from src/test/java/guide/syncsub.java rename to jeromq/src/test/java/guide/syncsub.java diff --git a/src/test/java/guide/tasksink.java b/jeromq/src/test/java/guide/tasksink.java similarity index 100% rename from src/test/java/guide/tasksink.java rename to jeromq/src/test/java/guide/tasksink.java diff --git a/src/test/java/guide/tasksink2.java b/jeromq/src/test/java/guide/tasksink2.java similarity index 100% rename from src/test/java/guide/tasksink2.java rename to jeromq/src/test/java/guide/tasksink2.java diff --git a/src/test/java/guide/taskvent.java b/jeromq/src/test/java/guide/taskvent.java similarity index 100% rename from src/test/java/guide/taskvent.java rename to jeromq/src/test/java/guide/taskvent.java diff --git a/src/test/java/guide/taskwork.java b/jeromq/src/test/java/guide/taskwork.java similarity index 100% rename from src/test/java/guide/taskwork.java rename to jeromq/src/test/java/guide/taskwork.java diff --git a/src/test/java/guide/taskwork2.java b/jeromq/src/test/java/guide/taskwork2.java similarity index 100% rename from src/test/java/guide/taskwork2.java rename to jeromq/src/test/java/guide/taskwork2.java diff --git a/src/test/java/guide/ticlient.java b/jeromq/src/test/java/guide/ticlient.java similarity index 100% rename from src/test/java/guide/ticlient.java rename to jeromq/src/test/java/guide/ticlient.java diff --git a/src/test/java/guide/titanic.java b/jeromq/src/test/java/guide/titanic.java similarity index 100% rename from src/test/java/guide/titanic.java rename to jeromq/src/test/java/guide/titanic.java diff --git a/src/test/java/guide/tripping.java b/jeromq/src/test/java/guide/tripping.java similarity index 100% rename from src/test/java/guide/tripping.java rename to jeromq/src/test/java/guide/tripping.java diff --git a/src/test/java/guide/version.java b/jeromq/src/test/java/guide/version.java similarity index 100% rename from src/test/java/guide/version.java rename to jeromq/src/test/java/guide/version.java diff --git a/src/test/java/guide/wuclient.java b/jeromq/src/test/java/guide/wuclient.java similarity index 100% rename from src/test/java/guide/wuclient.java rename to jeromq/src/test/java/guide/wuclient.java diff --git a/src/test/java/guide/wuproxy.java b/jeromq/src/test/java/guide/wuproxy.java similarity index 100% rename from src/test/java/guide/wuproxy.java rename to jeromq/src/test/java/guide/wuproxy.java diff --git a/src/test/java/guide/wuserver.java b/jeromq/src/test/java/guide/wuserver.java similarity index 100% rename from src/test/java/guide/wuserver.java rename to jeromq/src/test/java/guide/wuserver.java diff --git a/src/test/java/org/zeromq/ByteBuffersTest.java b/jeromq/src/test/java/org/zeromq/ByteBuffersTest.java similarity index 100% rename from src/test/java/org/zeromq/ByteBuffersTest.java rename to jeromq/src/test/java/org/zeromq/ByteBuffersTest.java diff --git a/src/test/java/org/zeromq/DealerDealerTest.java b/jeromq/src/test/java/org/zeromq/DealerDealerTest.java similarity index 100% rename from src/test/java/org/zeromq/DealerDealerTest.java rename to jeromq/src/test/java/org/zeromq/DealerDealerTest.java diff --git a/src/test/java/org/zeromq/HighWatermarkTest.java b/jeromq/src/test/java/org/zeromq/HighWatermarkTest.java similarity index 100% rename from src/test/java/org/zeromq/HighWatermarkTest.java rename to jeromq/src/test/java/org/zeromq/HighWatermarkTest.java diff --git a/src/test/java/org/zeromq/ParanoidPiratServerWithLazyPiratClientTest.java b/jeromq/src/test/java/org/zeromq/ParanoidPiratServerWithLazyPiratClientTest.java similarity index 100% rename from src/test/java/org/zeromq/ParanoidPiratServerWithLazyPiratClientTest.java rename to jeromq/src/test/java/org/zeromq/ParanoidPiratServerWithLazyPiratClientTest.java diff --git a/src/test/java/org/zeromq/PubSubTest.java b/jeromq/src/test/java/org/zeromq/PubSubTest.java similarity index 100% rename from src/test/java/org/zeromq/PubSubTest.java rename to jeromq/src/test/java/org/zeromq/PubSubTest.java diff --git a/src/test/java/org/zeromq/PushPullTest.java b/jeromq/src/test/java/org/zeromq/PushPullTest.java similarity index 100% rename from src/test/java/org/zeromq/PushPullTest.java rename to jeromq/src/test/java/org/zeromq/PushPullTest.java diff --git a/src/test/java/org/zeromq/ReqRepTest.java b/jeromq/src/test/java/org/zeromq/ReqRepTest.java similarity index 100% rename from src/test/java/org/zeromq/ReqRepTest.java rename to jeromq/src/test/java/org/zeromq/ReqRepTest.java diff --git a/src/test/java/org/zeromq/SelectorProviderTest.java b/jeromq/src/test/java/org/zeromq/SelectorProviderTest.java similarity index 100% rename from src/test/java/org/zeromq/SelectorProviderTest.java rename to jeromq/src/test/java/org/zeromq/SelectorProviderTest.java diff --git a/src/test/java/org/zeromq/TemporaryFolderFinder.java b/jeromq/src/test/java/org/zeromq/TemporaryFolderFinder.java similarity index 100% rename from src/test/java/org/zeromq/TemporaryFolderFinder.java rename to jeromq/src/test/java/org/zeromq/TemporaryFolderFinder.java diff --git a/src/test/java/org/zeromq/TestDisconnectInprocZeromq.java b/jeromq/src/test/java/org/zeromq/TestDisconnectInprocZeromq.java similarity index 100% rename from src/test/java/org/zeromq/TestDisconnectInprocZeromq.java rename to jeromq/src/test/java/org/zeromq/TestDisconnectInprocZeromq.java diff --git a/src/test/java/org/zeromq/TestEventResolution.java b/jeromq/src/test/java/org/zeromq/TestEventResolution.java similarity index 100% rename from src/test/java/org/zeromq/TestEventResolution.java rename to jeromq/src/test/java/org/zeromq/TestEventResolution.java diff --git a/src/test/java/org/zeromq/TestEvents.java b/jeromq/src/test/java/org/zeromq/TestEvents.java similarity index 100% rename from src/test/java/org/zeromq/TestEvents.java rename to jeromq/src/test/java/org/zeromq/TestEvents.java diff --git a/src/test/java/org/zeromq/TestPoller.java b/jeromq/src/test/java/org/zeromq/TestPoller.java similarity index 100% rename from src/test/java/org/zeromq/TestPoller.java rename to jeromq/src/test/java/org/zeromq/TestPoller.java diff --git a/src/test/java/org/zeromq/TestProxy.java b/jeromq/src/test/java/org/zeromq/TestProxy.java similarity index 100% rename from src/test/java/org/zeromq/TestProxy.java rename to jeromq/src/test/java/org/zeromq/TestProxy.java diff --git a/src/test/java/org/zeromq/TestPushPullThreadedTcp.java b/jeromq/src/test/java/org/zeromq/TestPushPullThreadedTcp.java similarity index 100% rename from src/test/java/org/zeromq/TestPushPullThreadedTcp.java rename to jeromq/src/test/java/org/zeromq/TestPushPullThreadedTcp.java diff --git a/src/test/java/org/zeromq/TestRapidOpenCloseSocket.java b/jeromq/src/test/java/org/zeromq/TestRapidOpenCloseSocket.java similarity index 100% rename from src/test/java/org/zeromq/TestRapidOpenCloseSocket.java rename to jeromq/src/test/java/org/zeromq/TestRapidOpenCloseSocket.java diff --git a/src/test/java/org/zeromq/TestReqRouterThreadedTcp.java b/jeromq/src/test/java/org/zeromq/TestReqRouterThreadedTcp.java similarity index 100% rename from src/test/java/org/zeromq/TestReqRouterThreadedTcp.java rename to jeromq/src/test/java/org/zeromq/TestReqRouterThreadedTcp.java diff --git a/src/test/java/org/zeromq/TestSocketStreams.java b/jeromq/src/test/java/org/zeromq/TestSocketStreams.java similarity index 100% rename from src/test/java/org/zeromq/TestSocketStreams.java rename to jeromq/src/test/java/org/zeromq/TestSocketStreams.java diff --git a/src/test/java/org/zeromq/TestZActor.java b/jeromq/src/test/java/org/zeromq/TestZActor.java similarity index 100% rename from src/test/java/org/zeromq/TestZActor.java rename to jeromq/src/test/java/org/zeromq/TestZActor.java diff --git a/src/test/java/org/zeromq/TestZCancellationToken.java b/jeromq/src/test/java/org/zeromq/TestZCancellationToken.java similarity index 100% rename from src/test/java/org/zeromq/TestZCancellationToken.java rename to jeromq/src/test/java/org/zeromq/TestZCancellationToken.java diff --git a/src/test/java/org/zeromq/TestZContext.java b/jeromq/src/test/java/org/zeromq/TestZContext.java similarity index 100% rename from src/test/java/org/zeromq/TestZContext.java rename to jeromq/src/test/java/org/zeromq/TestZContext.java diff --git a/src/test/java/org/zeromq/TestZLoop.java b/jeromq/src/test/java/org/zeromq/TestZLoop.java similarity index 100% rename from src/test/java/org/zeromq/TestZLoop.java rename to jeromq/src/test/java/org/zeromq/TestZLoop.java diff --git a/src/test/java/org/zeromq/TestZMQ.java b/jeromq/src/test/java/org/zeromq/TestZMQ.java similarity index 100% rename from src/test/java/org/zeromq/TestZMQ.java rename to jeromq/src/test/java/org/zeromq/TestZMQ.java diff --git a/src/test/java/org/zeromq/TestZPoller.java b/jeromq/src/test/java/org/zeromq/TestZPoller.java similarity index 100% rename from src/test/java/org/zeromq/TestZPoller.java rename to jeromq/src/test/java/org/zeromq/TestZPoller.java diff --git a/src/test/java/org/zeromq/TestZProxy.java b/jeromq/src/test/java/org/zeromq/TestZProxy.java similarity index 100% rename from src/test/java/org/zeromq/TestZProxy.java rename to jeromq/src/test/java/org/zeromq/TestZProxy.java diff --git a/src/test/java/org/zeromq/TestZStar.java b/jeromq/src/test/java/org/zeromq/TestZStar.java similarity index 100% rename from src/test/java/org/zeromq/TestZStar.java rename to jeromq/src/test/java/org/zeromq/TestZStar.java diff --git a/src/test/java/org/zeromq/TestZThread.java b/jeromq/src/test/java/org/zeromq/TestZThread.java similarity index 100% rename from src/test/java/org/zeromq/TestZThread.java rename to jeromq/src/test/java/org/zeromq/TestZThread.java diff --git a/src/test/java/org/zeromq/TooManyOpenFilesTester.java b/jeromq/src/test/java/org/zeromq/TooManyOpenFilesTester.java similarity index 100% rename from src/test/java/org/zeromq/TooManyOpenFilesTester.java rename to jeromq/src/test/java/org/zeromq/TooManyOpenFilesTester.java diff --git a/src/test/java/org/zeromq/XpubXsubZTest.java b/jeromq/src/test/java/org/zeromq/XpubXsubZTest.java similarity index 100% rename from src/test/java/org/zeromq/XpubXsubZTest.java rename to jeromq/src/test/java/org/zeromq/XpubXsubZTest.java diff --git a/src/test/java/org/zeromq/ZBeaconTest.java b/jeromq/src/test/java/org/zeromq/ZBeaconTest.java similarity index 100% rename from src/test/java/org/zeromq/ZBeaconTest.java rename to jeromq/src/test/java/org/zeromq/ZBeaconTest.java diff --git a/src/test/java/org/zeromq/ZCertStoreTest.java b/jeromq/src/test/java/org/zeromq/ZCertStoreTest.java similarity index 100% rename from src/test/java/org/zeromq/ZCertStoreTest.java rename to jeromq/src/test/java/org/zeromq/ZCertStoreTest.java diff --git a/src/test/java/org/zeromq/ZCertTest.java b/jeromq/src/test/java/org/zeromq/ZCertTest.java similarity index 100% rename from src/test/java/org/zeromq/ZCertTest.java rename to jeromq/src/test/java/org/zeromq/ZCertTest.java diff --git a/src/test/java/org/zeromq/ZFrameTest.java b/jeromq/src/test/java/org/zeromq/ZFrameTest.java similarity index 100% rename from src/test/java/org/zeromq/ZFrameTest.java rename to jeromq/src/test/java/org/zeromq/ZFrameTest.java diff --git a/src/test/java/org/zeromq/ZLoopTest.java b/jeromq/src/test/java/org/zeromq/ZLoopTest.java similarity index 100% rename from src/test/java/org/zeromq/ZLoopTest.java rename to jeromq/src/test/java/org/zeromq/ZLoopTest.java diff --git a/src/test/java/org/zeromq/ZMonitorTest.java b/jeromq/src/test/java/org/zeromq/ZMonitorTest.java similarity index 100% rename from src/test/java/org/zeromq/ZMonitorTest.java rename to jeromq/src/test/java/org/zeromq/ZMonitorTest.java diff --git a/src/test/java/org/zeromq/ZMsgTest.java b/jeromq/src/test/java/org/zeromq/ZMsgTest.java similarity index 100% rename from src/test/java/org/zeromq/ZMsgTest.java rename to jeromq/src/test/java/org/zeromq/ZMsgTest.java diff --git a/src/test/java/org/zeromq/ZSocketTest.java b/jeromq/src/test/java/org/zeromq/ZSocketTest.java similarity index 100% rename from src/test/java/org/zeromq/ZSocketTest.java rename to jeromq/src/test/java/org/zeromq/ZSocketTest.java diff --git a/src/test/java/org/zeromq/auth/TestUtils.java b/jeromq/src/test/java/org/zeromq/auth/TestUtils.java similarity index 100% rename from src/test/java/org/zeromq/auth/TestUtils.java rename to jeromq/src/test/java/org/zeromq/auth/TestUtils.java diff --git a/src/test/java/org/zeromq/auth/ZAuthTest.java b/jeromq/src/test/java/org/zeromq/auth/ZAuthTest.java similarity index 100% rename from src/test/java/org/zeromq/auth/ZAuthTest.java rename to jeromq/src/test/java/org/zeromq/auth/ZAuthTest.java diff --git a/src/test/java/org/zeromq/auth/ZConfigTest.java b/jeromq/src/test/java/org/zeromq/auth/ZConfigTest.java similarity index 100% rename from src/test/java/org/zeromq/auth/ZConfigTest.java rename to jeromq/src/test/java/org/zeromq/auth/ZConfigTest.java diff --git a/src/test/java/org/zeromq/guide/AsyncServerTest.java b/jeromq/src/test/java/org/zeromq/guide/AsyncServerTest.java similarity index 100% rename from src/test/java/org/zeromq/guide/AsyncServerTest.java rename to jeromq/src/test/java/org/zeromq/guide/AsyncServerTest.java diff --git a/src/test/java/org/zeromq/guide/EspressoTest.java b/jeromq/src/test/java/org/zeromq/guide/EspressoTest.java similarity index 100% rename from src/test/java/org/zeromq/guide/EspressoTest.java rename to jeromq/src/test/java/org/zeromq/guide/EspressoTest.java diff --git a/src/test/java/org/zeromq/proto/ZNeedleTest.java b/jeromq/src/test/java/org/zeromq/proto/ZNeedleTest.java similarity index 100% rename from src/test/java/org/zeromq/proto/ZNeedleTest.java rename to jeromq/src/test/java/org/zeromq/proto/ZNeedleTest.java diff --git a/src/test/java/org/zeromq/proto/ZPictureTest.java b/jeromq/src/test/java/org/zeromq/proto/ZPictureTest.java similarity index 100% rename from src/test/java/org/zeromq/proto/ZPictureTest.java rename to jeromq/src/test/java/org/zeromq/proto/ZPictureTest.java diff --git a/src/test/java/org/zeromq/timer/ZTickerTest.java b/jeromq/src/test/java/org/zeromq/timer/ZTickerTest.java similarity index 100% rename from src/test/java/org/zeromq/timer/ZTickerTest.java rename to jeromq/src/test/java/org/zeromq/timer/ZTickerTest.java diff --git a/src/test/java/org/zeromq/timer/ZTicketTest.java b/jeromq/src/test/java/org/zeromq/timer/ZTicketTest.java similarity index 100% rename from src/test/java/org/zeromq/timer/ZTicketTest.java rename to jeromq/src/test/java/org/zeromq/timer/ZTicketTest.java diff --git a/src/test/java/org/zeromq/timer/ZTimerTest.java b/jeromq/src/test/java/org/zeromq/timer/ZTimerTest.java similarity index 100% rename from src/test/java/org/zeromq/timer/ZTimerTest.java rename to jeromq/src/test/java/org/zeromq/timer/ZTimerTest.java diff --git a/src/test/java/org/zeromq/util/ZDataTest.java b/jeromq/src/test/java/org/zeromq/util/ZDataTest.java similarity index 100% rename from src/test/java/org/zeromq/util/ZDataTest.java rename to jeromq/src/test/java/org/zeromq/util/ZDataTest.java diff --git a/src/test/java/org/zeromq/util/ZDigestTest.java b/jeromq/src/test/java/org/zeromq/util/ZDigestTest.java similarity index 100% rename from src/test/java/org/zeromq/util/ZDigestTest.java rename to jeromq/src/test/java/org/zeromq/util/ZDigestTest.java diff --git a/src/test/java/perf/InprocLat.java b/jeromq/src/test/java/perf/InprocLat.java similarity index 100% rename from src/test/java/perf/InprocLat.java rename to jeromq/src/test/java/perf/InprocLat.java diff --git a/src/test/java/perf/LocalLat.java b/jeromq/src/test/java/perf/LocalLat.java similarity index 100% rename from src/test/java/perf/LocalLat.java rename to jeromq/src/test/java/perf/LocalLat.java diff --git a/src/test/java/perf/LocalThr.java b/jeromq/src/test/java/perf/LocalThr.java similarity index 100% rename from src/test/java/perf/LocalThr.java rename to jeromq/src/test/java/perf/LocalThr.java diff --git a/src/test/java/perf/RemoteThr.java b/jeromq/src/test/java/perf/RemoteThr.java similarity index 100% rename from src/test/java/perf/RemoteThr.java rename to jeromq/src/test/java/perf/RemoteThr.java diff --git a/src/test/java/zmq/ConnectRidTest.java b/jeromq/src/test/java/zmq/ConnectRidTest.java similarity index 100% rename from src/test/java/zmq/ConnectRidTest.java rename to jeromq/src/test/java/zmq/ConnectRidTest.java diff --git a/src/test/java/zmq/CtxTest.java b/jeromq/src/test/java/zmq/CtxTest.java similarity index 100% rename from src/test/java/zmq/CtxTest.java rename to jeromq/src/test/java/zmq/CtxTest.java diff --git a/src/test/java/zmq/DiffServerTest.java b/jeromq/src/test/java/zmq/DiffServerTest.java similarity index 100% rename from src/test/java/zmq/DiffServerTest.java rename to jeromq/src/test/java/zmq/DiffServerTest.java diff --git a/src/test/java/zmq/HeartbeatsTest.java b/jeromq/src/test/java/zmq/HeartbeatsTest.java similarity index 100% rename from src/test/java/zmq/HeartbeatsTest.java rename to jeromq/src/test/java/zmq/HeartbeatsTest.java diff --git a/src/test/java/zmq/Helper.java b/jeromq/src/test/java/zmq/Helper.java similarity index 100% rename from src/test/java/zmq/Helper.java rename to jeromq/src/test/java/zmq/Helper.java diff --git a/src/test/java/zmq/ImmediateTest.java b/jeromq/src/test/java/zmq/ImmediateTest.java similarity index 100% rename from src/test/java/zmq/ImmediateTest.java rename to jeromq/src/test/java/zmq/ImmediateTest.java diff --git a/src/test/java/zmq/InprocDisconnectTest.java b/jeromq/src/test/java/zmq/InprocDisconnectTest.java similarity index 100% rename from src/test/java/zmq/InprocDisconnectTest.java rename to jeromq/src/test/java/zmq/InprocDisconnectTest.java diff --git a/src/test/java/zmq/InprocUnbindTest.java b/jeromq/src/test/java/zmq/InprocUnbindTest.java similarity index 100% rename from src/test/java/zmq/InprocUnbindTest.java rename to jeromq/src/test/java/zmq/InprocUnbindTest.java diff --git a/src/test/java/zmq/OptionsTest.java b/jeromq/src/test/java/zmq/OptionsTest.java similarity index 100% rename from src/test/java/zmq/OptionsTest.java rename to jeromq/src/test/java/zmq/OptionsTest.java diff --git a/src/test/java/zmq/PollTest.java b/jeromq/src/test/java/zmq/PollTest.java similarity index 100% rename from src/test/java/zmq/PollTest.java rename to jeromq/src/test/java/zmq/PollTest.java diff --git a/src/test/java/zmq/TermEndpointIpcTest.java b/jeromq/src/test/java/zmq/TermEndpointIpcTest.java similarity index 100% rename from src/test/java/zmq/TermEndpointIpcTest.java rename to jeromq/src/test/java/zmq/TermEndpointIpcTest.java diff --git a/src/test/java/zmq/TestChannel.java b/jeromq/src/test/java/zmq/TestChannel.java similarity index 100% rename from src/test/java/zmq/TestChannel.java rename to jeromq/src/test/java/zmq/TestChannel.java diff --git a/src/test/java/zmq/TestClientServer.java b/jeromq/src/test/java/zmq/TestClientServer.java similarity index 100% rename from src/test/java/zmq/TestClientServer.java rename to jeromq/src/test/java/zmq/TestClientServer.java diff --git a/src/test/java/zmq/TestConnectDelay.java b/jeromq/src/test/java/zmq/TestConnectDelay.java similarity index 100% rename from src/test/java/zmq/TestConnectDelay.java rename to jeromq/src/test/java/zmq/TestConnectDelay.java diff --git a/src/test/java/zmq/TestConnectResolve.java b/jeromq/src/test/java/zmq/TestConnectResolve.java similarity index 100% rename from src/test/java/zmq/TestConnectResolve.java rename to jeromq/src/test/java/zmq/TestConnectResolve.java diff --git a/src/test/java/zmq/TestDisconnectMsg.java b/jeromq/src/test/java/zmq/TestDisconnectMsg.java similarity index 100% rename from src/test/java/zmq/TestDisconnectMsg.java rename to jeromq/src/test/java/zmq/TestDisconnectMsg.java diff --git a/src/test/java/zmq/TestHelloMsg.java b/jeromq/src/test/java/zmq/TestHelloMsg.java similarity index 100% rename from src/test/java/zmq/TestHelloMsg.java rename to jeromq/src/test/java/zmq/TestHelloMsg.java diff --git a/src/test/java/zmq/TestHiccupMsg.java b/jeromq/src/test/java/zmq/TestHiccupMsg.java similarity index 100% rename from src/test/java/zmq/TestHiccupMsg.java rename to jeromq/src/test/java/zmq/TestHiccupMsg.java diff --git a/src/test/java/zmq/TestHwm.java b/jeromq/src/test/java/zmq/TestHwm.java similarity index 100% rename from src/test/java/zmq/TestHwm.java rename to jeromq/src/test/java/zmq/TestHwm.java diff --git a/src/test/java/zmq/TestLastEndpoint.java b/jeromq/src/test/java/zmq/TestLastEndpoint.java similarity index 100% rename from src/test/java/zmq/TestLastEndpoint.java rename to jeromq/src/test/java/zmq/TestLastEndpoint.java diff --git a/src/test/java/zmq/TestMonitor.java b/jeromq/src/test/java/zmq/TestMonitor.java similarity index 100% rename from src/test/java/zmq/TestMonitor.java rename to jeromq/src/test/java/zmq/TestMonitor.java diff --git a/src/test/java/zmq/TestMsg.java b/jeromq/src/test/java/zmq/TestMsg.java similarity index 100% rename from src/test/java/zmq/TestMsg.java rename to jeromq/src/test/java/zmq/TestMsg.java diff --git a/src/test/java/zmq/TestMsgDirect.java b/jeromq/src/test/java/zmq/TestMsgDirect.java similarity index 100% rename from src/test/java/zmq/TestMsgDirect.java rename to jeromq/src/test/java/zmq/TestMsgDirect.java diff --git a/src/test/java/zmq/TestMsgFlags.java b/jeromq/src/test/java/zmq/TestMsgFlags.java similarity index 100% rename from src/test/java/zmq/TestMsgFlags.java rename to jeromq/src/test/java/zmq/TestMsgFlags.java diff --git a/src/test/java/zmq/TestPeer.java b/jeromq/src/test/java/zmq/TestPeer.java similarity index 100% rename from src/test/java/zmq/TestPeer.java rename to jeromq/src/test/java/zmq/TestPeer.java diff --git a/src/test/java/zmq/TestRadioDish.java b/jeromq/src/test/java/zmq/TestRadioDish.java similarity index 100% rename from src/test/java/zmq/TestRadioDish.java rename to jeromq/src/test/java/zmq/TestRadioDish.java diff --git a/src/test/java/zmq/TestRaw.java b/jeromq/src/test/java/zmq/TestRaw.java similarity index 100% rename from src/test/java/zmq/TestRaw.java rename to jeromq/src/test/java/zmq/TestRaw.java diff --git a/src/test/java/zmq/TestScatterGather.java b/jeromq/src/test/java/zmq/TestScatterGather.java similarity index 100% rename from src/test/java/zmq/TestScatterGather.java rename to jeromq/src/test/java/zmq/TestScatterGather.java diff --git a/src/test/java/zmq/TestShutdownStress.java b/jeromq/src/test/java/zmq/TestShutdownStress.java similarity index 100% rename from src/test/java/zmq/TestShutdownStress.java rename to jeromq/src/test/java/zmq/TestShutdownStress.java diff --git a/src/test/java/zmq/TestSocketPoll.java b/jeromq/src/test/java/zmq/TestSocketPoll.java similarity index 100% rename from src/test/java/zmq/TestSocketPoll.java rename to jeromq/src/test/java/zmq/TestSocketPoll.java diff --git a/src/test/java/zmq/TestTermEndpoint.java b/jeromq/src/test/java/zmq/TestTermEndpoint.java similarity index 100% rename from src/test/java/zmq/TestTermEndpoint.java rename to jeromq/src/test/java/zmq/TestTermEndpoint.java diff --git a/src/test/java/zmq/TestTimeo.java b/jeromq/src/test/java/zmq/TestTimeo.java similarity index 100% rename from src/test/java/zmq/TestTimeo.java rename to jeromq/src/test/java/zmq/TestTimeo.java diff --git a/src/test/java/zmq/io/AbstractProtocolVersion.java b/jeromq/src/test/java/zmq/io/AbstractProtocolVersion.java similarity index 100% rename from src/test/java/zmq/io/AbstractProtocolVersion.java rename to jeromq/src/test/java/zmq/io/AbstractProtocolVersion.java diff --git a/src/test/java/zmq/io/MetadataTest.java b/jeromq/src/test/java/zmq/io/MetadataTest.java similarity index 100% rename from src/test/java/zmq/io/MetadataTest.java rename to jeromq/src/test/java/zmq/io/MetadataTest.java diff --git a/src/test/java/zmq/io/MsgsTest.java b/jeromq/src/test/java/zmq/io/MsgsTest.java similarity index 100% rename from src/test/java/zmq/io/MsgsTest.java rename to jeromq/src/test/java/zmq/io/MsgsTest.java diff --git a/src/test/java/zmq/io/StreamEngineTest.java b/jeromq/src/test/java/zmq/io/StreamEngineTest.java similarity index 100% rename from src/test/java/zmq/io/StreamEngineTest.java rename to jeromq/src/test/java/zmq/io/StreamEngineTest.java diff --git a/src/test/java/zmq/io/TimerEventTest.java b/jeromq/src/test/java/zmq/io/TimerEventTest.java similarity index 100% rename from src/test/java/zmq/io/TimerEventTest.java rename to jeromq/src/test/java/zmq/io/TimerEventTest.java diff --git a/src/test/java/zmq/io/V0ProtocolTest.java b/jeromq/src/test/java/zmq/io/V0ProtocolTest.java similarity index 100% rename from src/test/java/zmq/io/V0ProtocolTest.java rename to jeromq/src/test/java/zmq/io/V0ProtocolTest.java diff --git a/src/test/java/zmq/io/V1ProtocolTest.java b/jeromq/src/test/java/zmq/io/V1ProtocolTest.java similarity index 100% rename from src/test/java/zmq/io/V1ProtocolTest.java rename to jeromq/src/test/java/zmq/io/V1ProtocolTest.java diff --git a/src/test/java/zmq/io/V2ProtocolTest.java b/jeromq/src/test/java/zmq/io/V2ProtocolTest.java similarity index 100% rename from src/test/java/zmq/io/V2ProtocolTest.java rename to jeromq/src/test/java/zmq/io/V2ProtocolTest.java diff --git a/src/test/java/zmq/io/coder/AbstractDecoderTest.java b/jeromq/src/test/java/zmq/io/coder/AbstractDecoderTest.java similarity index 100% rename from src/test/java/zmq/io/coder/AbstractDecoderTest.java rename to jeromq/src/test/java/zmq/io/coder/AbstractDecoderTest.java diff --git a/src/test/java/zmq/io/coder/CustomDecoderTest.java b/jeromq/src/test/java/zmq/io/coder/CustomDecoderTest.java similarity index 100% rename from src/test/java/zmq/io/coder/CustomDecoderTest.java rename to jeromq/src/test/java/zmq/io/coder/CustomDecoderTest.java diff --git a/src/test/java/zmq/io/coder/CustomEncoderTest.java b/jeromq/src/test/java/zmq/io/coder/CustomEncoderTest.java similarity index 100% rename from src/test/java/zmq/io/coder/CustomEncoderTest.java rename to jeromq/src/test/java/zmq/io/coder/CustomEncoderTest.java diff --git a/src/test/java/zmq/io/coder/V1DecoderTest.java b/jeromq/src/test/java/zmq/io/coder/V1DecoderTest.java similarity index 100% rename from src/test/java/zmq/io/coder/V1DecoderTest.java rename to jeromq/src/test/java/zmq/io/coder/V1DecoderTest.java diff --git a/src/test/java/zmq/io/coder/V1EncoderTest.java b/jeromq/src/test/java/zmq/io/coder/V1EncoderTest.java similarity index 100% rename from src/test/java/zmq/io/coder/V1EncoderTest.java rename to jeromq/src/test/java/zmq/io/coder/V1EncoderTest.java diff --git a/src/test/java/zmq/io/coder/V2DecoderTest.java b/jeromq/src/test/java/zmq/io/coder/V2DecoderTest.java similarity index 100% rename from src/test/java/zmq/io/coder/V2DecoderTest.java rename to jeromq/src/test/java/zmq/io/coder/V2DecoderTest.java diff --git a/src/test/java/zmq/io/coder/V2EncoderTest.java b/jeromq/src/test/java/zmq/io/coder/V2EncoderTest.java similarity index 100% rename from src/test/java/zmq/io/coder/V2EncoderTest.java rename to jeromq/src/test/java/zmq/io/coder/V2EncoderTest.java diff --git a/src/test/java/zmq/io/mechanism/MechanismTester.java b/jeromq/src/test/java/zmq/io/mechanism/MechanismTester.java similarity index 100% rename from src/test/java/zmq/io/mechanism/MechanismTester.java rename to jeromq/src/test/java/zmq/io/mechanism/MechanismTester.java diff --git a/src/test/java/zmq/io/mechanism/SecurityCurveTest.java b/jeromq/src/test/java/zmq/io/mechanism/SecurityCurveTest.java similarity index 100% rename from src/test/java/zmq/io/mechanism/SecurityCurveTest.java rename to jeromq/src/test/java/zmq/io/mechanism/SecurityCurveTest.java diff --git a/src/test/java/zmq/io/mechanism/SecurityNullTest.java b/jeromq/src/test/java/zmq/io/mechanism/SecurityNullTest.java similarity index 100% rename from src/test/java/zmq/io/mechanism/SecurityNullTest.java rename to jeromq/src/test/java/zmq/io/mechanism/SecurityNullTest.java diff --git a/src/test/java/zmq/io/mechanism/SecurityPlainTest.java b/jeromq/src/test/java/zmq/io/mechanism/SecurityPlainTest.java similarity index 100% rename from src/test/java/zmq/io/mechanism/SecurityPlainTest.java rename to jeromq/src/test/java/zmq/io/mechanism/SecurityPlainTest.java diff --git a/src/test/java/zmq/io/mechanism/ZapHandler.java b/jeromq/src/test/java/zmq/io/mechanism/ZapHandler.java similarity index 100% rename from src/test/java/zmq/io/mechanism/ZapHandler.java rename to jeromq/src/test/java/zmq/io/mechanism/ZapHandler.java diff --git a/src/test/java/zmq/io/net/BindSrcAddressTest.java b/jeromq/src/test/java/zmq/io/net/BindSrcAddressTest.java similarity index 100% rename from src/test/java/zmq/io/net/BindSrcAddressTest.java rename to jeromq/src/test/java/zmq/io/net/BindSrcAddressTest.java diff --git a/src/test/java/zmq/io/net/TestAddress.java b/jeromq/src/test/java/zmq/io/net/TestAddress.java similarity index 100% rename from src/test/java/zmq/io/net/TestAddress.java rename to jeromq/src/test/java/zmq/io/net/TestAddress.java diff --git a/src/test/java/zmq/io/net/tcp/KeepAliveTest.java b/jeromq/src/test/java/zmq/io/net/tcp/KeepAliveTest.java similarity index 100% rename from src/test/java/zmq/io/net/tcp/KeepAliveTest.java rename to jeromq/src/test/java/zmq/io/net/tcp/KeepAliveTest.java diff --git a/src/test/java/zmq/io/net/tcp/TcpAddressTest.java b/jeromq/src/test/java/zmq/io/net/tcp/TcpAddressTest.java similarity index 100% rename from src/test/java/zmq/io/net/tcp/TcpAddressTest.java rename to jeromq/src/test/java/zmq/io/net/tcp/TcpAddressTest.java diff --git a/src/test/java/zmq/pipe/ConflateTest.java b/jeromq/src/test/java/zmq/pipe/ConflateTest.java similarity index 100% rename from src/test/java/zmq/pipe/ConflateTest.java rename to jeromq/src/test/java/zmq/pipe/ConflateTest.java diff --git a/src/test/java/zmq/pipe/YQueueTest.java b/jeromq/src/test/java/zmq/pipe/YQueueTest.java similarity index 100% rename from src/test/java/zmq/pipe/YQueueTest.java rename to jeromq/src/test/java/zmq/pipe/YQueueTest.java diff --git a/src/test/java/zmq/poll/PollEvents.java b/jeromq/src/test/java/zmq/poll/PollEvents.java similarity index 100% rename from src/test/java/zmq/poll/PollEvents.java rename to jeromq/src/test/java/zmq/poll/PollEvents.java diff --git a/src/test/java/zmq/poll/PollerBaseTest.java b/jeromq/src/test/java/zmq/poll/PollerBaseTest.java similarity index 100% rename from src/test/java/zmq/poll/PollerBaseTest.java rename to jeromq/src/test/java/zmq/poll/PollerBaseTest.java diff --git a/src/test/java/zmq/poll/PollerBaseTested.java b/jeromq/src/test/java/zmq/poll/PollerBaseTested.java similarity index 100% rename from src/test/java/zmq/poll/PollerBaseTested.java rename to jeromq/src/test/java/zmq/poll/PollerBaseTested.java diff --git a/src/test/java/zmq/poll/PollerTest.java b/jeromq/src/test/java/zmq/poll/PollerTest.java similarity index 100% rename from src/test/java/zmq/poll/PollerTest.java rename to jeromq/src/test/java/zmq/poll/PollerTest.java diff --git a/src/test/java/zmq/proxy/ProxySingleSocketTest.java b/jeromq/src/test/java/zmq/proxy/ProxySingleSocketTest.java similarity index 100% rename from src/test/java/zmq/proxy/ProxySingleSocketTest.java rename to jeromq/src/test/java/zmq/proxy/ProxySingleSocketTest.java diff --git a/src/test/java/zmq/proxy/ProxyTcpTest.java b/jeromq/src/test/java/zmq/proxy/ProxyTcpTest.java similarity index 100% rename from src/test/java/zmq/proxy/ProxyTcpTest.java rename to jeromq/src/test/java/zmq/proxy/ProxyTcpTest.java diff --git a/src/test/java/zmq/proxy/ProxyTerminateTest.java b/jeromq/src/test/java/zmq/proxy/ProxyTerminateTest.java similarity index 100% rename from src/test/java/zmq/proxy/ProxyTerminateTest.java rename to jeromq/src/test/java/zmq/proxy/ProxyTerminateTest.java diff --git a/src/test/java/zmq/proxy/ProxyTest.java b/jeromq/src/test/java/zmq/proxy/ProxyTest.java similarity index 100% rename from src/test/java/zmq/proxy/ProxyTest.java rename to jeromq/src/test/java/zmq/proxy/ProxyTest.java diff --git a/src/test/java/zmq/socket/AbstractSpecTest.java b/jeromq/src/test/java/zmq/socket/AbstractSpecTest.java similarity index 100% rename from src/test/java/zmq/socket/AbstractSpecTest.java rename to jeromq/src/test/java/zmq/socket/AbstractSpecTest.java diff --git a/src/test/java/zmq/socket/pair/TestPairInproc.java b/jeromq/src/test/java/zmq/socket/pair/TestPairInproc.java similarity index 100% rename from src/test/java/zmq/socket/pair/TestPairInproc.java rename to jeromq/src/test/java/zmq/socket/pair/TestPairInproc.java diff --git a/src/test/java/zmq/socket/pair/TestPairIpc.java b/jeromq/src/test/java/zmq/socket/pair/TestPairIpc.java similarity index 100% rename from src/test/java/zmq/socket/pair/TestPairIpc.java rename to jeromq/src/test/java/zmq/socket/pair/TestPairIpc.java diff --git a/src/test/java/zmq/socket/pair/TestPairTcp.java b/jeromq/src/test/java/zmq/socket/pair/TestPairTcp.java similarity index 100% rename from src/test/java/zmq/socket/pair/TestPairTcp.java rename to jeromq/src/test/java/zmq/socket/pair/TestPairTcp.java diff --git a/src/test/java/zmq/socket/pipeline/PushPullSpecTest.java b/jeromq/src/test/java/zmq/socket/pipeline/PushPullSpecTest.java similarity index 100% rename from src/test/java/zmq/socket/pipeline/PushPullSpecTest.java rename to jeromq/src/test/java/zmq/socket/pipeline/PushPullSpecTest.java diff --git a/src/test/java/zmq/socket/pipeline/TestPushPullTcp.java b/jeromq/src/test/java/zmq/socket/pipeline/TestPushPullTcp.java similarity index 100% rename from src/test/java/zmq/socket/pipeline/TestPushPullTcp.java rename to jeromq/src/test/java/zmq/socket/pipeline/TestPushPullTcp.java diff --git a/src/test/java/zmq/socket/pubsub/DistTest.java b/jeromq/src/test/java/zmq/socket/pubsub/DistTest.java similarity index 100% rename from src/test/java/zmq/socket/pubsub/DistTest.java rename to jeromq/src/test/java/zmq/socket/pubsub/DistTest.java diff --git a/src/test/java/zmq/socket/pubsub/MTrieTest.java b/jeromq/src/test/java/zmq/socket/pubsub/MTrieTest.java similarity index 100% rename from src/test/java/zmq/socket/pubsub/MTrieTest.java rename to jeromq/src/test/java/zmq/socket/pubsub/MTrieTest.java diff --git a/src/test/java/zmq/socket/pubsub/PubSubHwmTest.java b/jeromq/src/test/java/zmq/socket/pubsub/PubSubHwmTest.java similarity index 100% rename from src/test/java/zmq/socket/pubsub/PubSubHwmTest.java rename to jeromq/src/test/java/zmq/socket/pubsub/PubSubHwmTest.java diff --git a/src/test/java/zmq/socket/pubsub/PubTest.java b/jeromq/src/test/java/zmq/socket/pubsub/PubTest.java similarity index 100% rename from src/test/java/zmq/socket/pubsub/PubTest.java rename to jeromq/src/test/java/zmq/socket/pubsub/PubTest.java diff --git a/src/test/java/zmq/socket/pubsub/SubTest.java b/jeromq/src/test/java/zmq/socket/pubsub/SubTest.java similarity index 100% rename from src/test/java/zmq/socket/pubsub/SubTest.java rename to jeromq/src/test/java/zmq/socket/pubsub/SubTest.java diff --git a/src/test/java/zmq/socket/pubsub/TestPubsubTcp.java b/jeromq/src/test/java/zmq/socket/pubsub/TestPubsubTcp.java similarity index 100% rename from src/test/java/zmq/socket/pubsub/TestPubsubTcp.java rename to jeromq/src/test/java/zmq/socket/pubsub/TestPubsubTcp.java diff --git a/src/test/java/zmq/socket/pubsub/TestSubForward.java b/jeromq/src/test/java/zmq/socket/pubsub/TestSubForward.java similarity index 100% rename from src/test/java/zmq/socket/pubsub/TestSubForward.java rename to jeromq/src/test/java/zmq/socket/pubsub/TestSubForward.java diff --git a/src/test/java/zmq/socket/pubsub/TrieTest.java b/jeromq/src/test/java/zmq/socket/pubsub/TrieTest.java similarity index 100% rename from src/test/java/zmq/socket/pubsub/TrieTest.java rename to jeromq/src/test/java/zmq/socket/pubsub/TrieTest.java diff --git a/src/test/java/zmq/socket/pubsub/XPubManualTest.java b/jeromq/src/test/java/zmq/socket/pubsub/XPubManualTest.java similarity index 100% rename from src/test/java/zmq/socket/pubsub/XPubManualTest.java rename to jeromq/src/test/java/zmq/socket/pubsub/XPubManualTest.java diff --git a/src/test/java/zmq/socket/pubsub/XPubNodropTest.java b/jeromq/src/test/java/zmq/socket/pubsub/XPubNodropTest.java similarity index 100% rename from src/test/java/zmq/socket/pubsub/XPubNodropTest.java rename to jeromq/src/test/java/zmq/socket/pubsub/XPubNodropTest.java diff --git a/src/test/java/zmq/socket/pubsub/XPubTest.java b/jeromq/src/test/java/zmq/socket/pubsub/XPubTest.java similarity index 100% rename from src/test/java/zmq/socket/pubsub/XPubTest.java rename to jeromq/src/test/java/zmq/socket/pubsub/XPubTest.java diff --git a/src/test/java/zmq/socket/pubsub/XpubXsubTest.java b/jeromq/src/test/java/zmq/socket/pubsub/XpubXsubTest.java similarity index 100% rename from src/test/java/zmq/socket/pubsub/XpubXsubTest.java rename to jeromq/src/test/java/zmq/socket/pubsub/XpubXsubTest.java diff --git a/src/test/java/zmq/socket/reqrep/DealerDealerTest.java b/jeromq/src/test/java/zmq/socket/reqrep/DealerDealerTest.java similarity index 100% rename from src/test/java/zmq/socket/reqrep/DealerDealerTest.java rename to jeromq/src/test/java/zmq/socket/reqrep/DealerDealerTest.java diff --git a/src/test/java/zmq/socket/reqrep/DealerSpecTest.java b/jeromq/src/test/java/zmq/socket/reqrep/DealerSpecTest.java similarity index 100% rename from src/test/java/zmq/socket/reqrep/DealerSpecTest.java rename to jeromq/src/test/java/zmq/socket/reqrep/DealerSpecTest.java diff --git a/src/test/java/zmq/socket/reqrep/RepSpecTest.java b/jeromq/src/test/java/zmq/socket/reqrep/RepSpecTest.java similarity index 100% rename from src/test/java/zmq/socket/reqrep/RepSpecTest.java rename to jeromq/src/test/java/zmq/socket/reqrep/RepSpecTest.java diff --git a/src/test/java/zmq/socket/reqrep/ReqSpecTest.java b/jeromq/src/test/java/zmq/socket/reqrep/ReqSpecTest.java similarity index 100% rename from src/test/java/zmq/socket/reqrep/ReqSpecTest.java rename to jeromq/src/test/java/zmq/socket/reqrep/ReqSpecTest.java diff --git a/src/test/java/zmq/socket/reqrep/RouterHandoverTest.java b/jeromq/src/test/java/zmq/socket/reqrep/RouterHandoverTest.java similarity index 100% rename from src/test/java/zmq/socket/reqrep/RouterHandoverTest.java rename to jeromq/src/test/java/zmq/socket/reqrep/RouterHandoverTest.java diff --git a/src/test/java/zmq/socket/reqrep/RouterMandatoryTest.java b/jeromq/src/test/java/zmq/socket/reqrep/RouterMandatoryTest.java similarity index 100% rename from src/test/java/zmq/socket/reqrep/RouterMandatoryTest.java rename to jeromq/src/test/java/zmq/socket/reqrep/RouterMandatoryTest.java diff --git a/src/test/java/zmq/socket/reqrep/RouterProbeTest.java b/jeromq/src/test/java/zmq/socket/reqrep/RouterProbeTest.java similarity index 100% rename from src/test/java/zmq/socket/reqrep/RouterProbeTest.java rename to jeromq/src/test/java/zmq/socket/reqrep/RouterProbeTest.java diff --git a/src/test/java/zmq/socket/reqrep/RouterSpecTest.java b/jeromq/src/test/java/zmq/socket/reqrep/RouterSpecTest.java similarity index 100% rename from src/test/java/zmq/socket/reqrep/RouterSpecTest.java rename to jeromq/src/test/java/zmq/socket/reqrep/RouterSpecTest.java diff --git a/src/test/java/zmq/socket/reqrep/TestInvalidRep.java b/jeromq/src/test/java/zmq/socket/reqrep/TestInvalidRep.java similarity index 100% rename from src/test/java/zmq/socket/reqrep/TestInvalidRep.java rename to jeromq/src/test/java/zmq/socket/reqrep/TestInvalidRep.java diff --git a/src/test/java/zmq/socket/reqrep/TestReqCorrelateRelaxed.java b/jeromq/src/test/java/zmq/socket/reqrep/TestReqCorrelateRelaxed.java similarity index 100% rename from src/test/java/zmq/socket/reqrep/TestReqCorrelateRelaxed.java rename to jeromq/src/test/java/zmq/socket/reqrep/TestReqCorrelateRelaxed.java diff --git a/src/test/java/zmq/socket/reqrep/TestReqRelaxed.java b/jeromq/src/test/java/zmq/socket/reqrep/TestReqRelaxed.java similarity index 100% rename from src/test/java/zmq/socket/reqrep/TestReqRelaxed.java rename to jeromq/src/test/java/zmq/socket/reqrep/TestReqRelaxed.java diff --git a/src/test/java/zmq/socket/reqrep/TestReqrepDevice.java b/jeromq/src/test/java/zmq/socket/reqrep/TestReqrepDevice.java similarity index 100% rename from src/test/java/zmq/socket/reqrep/TestReqrepDevice.java rename to jeromq/src/test/java/zmq/socket/reqrep/TestReqrepDevice.java diff --git a/src/test/java/zmq/socket/reqrep/TestReqrepInproc.java b/jeromq/src/test/java/zmq/socket/reqrep/TestReqrepInproc.java similarity index 100% rename from src/test/java/zmq/socket/reqrep/TestReqrepInproc.java rename to jeromq/src/test/java/zmq/socket/reqrep/TestReqrepInproc.java diff --git a/src/test/java/zmq/socket/reqrep/TestReqrepIpc.java b/jeromq/src/test/java/zmq/socket/reqrep/TestReqrepIpc.java similarity index 100% rename from src/test/java/zmq/socket/reqrep/TestReqrepIpc.java rename to jeromq/src/test/java/zmq/socket/reqrep/TestReqrepIpc.java diff --git a/src/test/java/zmq/socket/reqrep/TestReqrepTcp.java b/jeromq/src/test/java/zmq/socket/reqrep/TestReqrepTcp.java similarity index 100% rename from src/test/java/zmq/socket/reqrep/TestReqrepTcp.java rename to jeromq/src/test/java/zmq/socket/reqrep/TestReqrepTcp.java diff --git a/src/test/java/zmq/socket/reqrep/TestRouterMandatory.java b/jeromq/src/test/java/zmq/socket/reqrep/TestRouterMandatory.java similarity index 100% rename from src/test/java/zmq/socket/reqrep/TestRouterMandatory.java rename to jeromq/src/test/java/zmq/socket/reqrep/TestRouterMandatory.java diff --git a/src/test/java/zmq/socket/stream/StreamEmptyTest.java b/jeromq/src/test/java/zmq/socket/stream/StreamEmptyTest.java similarity index 100% rename from src/test/java/zmq/socket/stream/StreamEmptyTest.java rename to jeromq/src/test/java/zmq/socket/stream/StreamEmptyTest.java diff --git a/src/test/java/zmq/socket/stream/StreamTest.java b/jeromq/src/test/java/zmq/socket/stream/StreamTest.java similarity index 100% rename from src/test/java/zmq/socket/stream/StreamTest.java rename to jeromq/src/test/java/zmq/socket/stream/StreamTest.java diff --git a/src/test/java/zmq/util/AndroidProblematic.java b/jeromq/src/test/java/zmq/util/AndroidProblematic.java similarity index 100% rename from src/test/java/zmq/util/AndroidProblematic.java rename to jeromq/src/test/java/zmq/util/AndroidProblematic.java diff --git a/src/test/java/zmq/util/MultimapTest.java b/jeromq/src/test/java/zmq/util/MultimapTest.java similarity index 100% rename from src/test/java/zmq/util/MultimapTest.java rename to jeromq/src/test/java/zmq/util/MultimapTest.java diff --git a/src/test/java/zmq/util/TestBlob.java b/jeromq/src/test/java/zmq/util/TestBlob.java similarity index 100% rename from src/test/java/zmq/util/TestBlob.java rename to jeromq/src/test/java/zmq/util/TestBlob.java diff --git a/src/test/java/zmq/util/TestUtils.java b/jeromq/src/test/java/zmq/util/TestUtils.java similarity index 100% rename from src/test/java/zmq/util/TestUtils.java rename to jeromq/src/test/java/zmq/util/TestUtils.java diff --git a/src/test/java/zmq/util/TimersTest.java b/jeromq/src/test/java/zmq/util/TimersTest.java similarity index 100% rename from src/test/java/zmq/util/TimersTest.java rename to jeromq/src/test/java/zmq/util/TimersTest.java diff --git a/src/test/java/zmq/util/WireTest.java b/jeromq/src/test/java/zmq/util/WireTest.java similarity index 100% rename from src/test/java/zmq/util/WireTest.java rename to jeromq/src/test/java/zmq/util/WireTest.java diff --git a/pom.xml b/pom.xml index e469be650..ee49405db 100644 --- a/pom.xml +++ b/pom.xml @@ -1,8 +1,12 @@ 4.0.0 org.zeromq - jeromq - jar + jeromq-pom + pom + + jeromq-ipc + jeromq + 0.6.0-SNAPSHOT JeroMQ Pure Java implementation of libzmq @@ -21,15 +25,16 @@ + ${project.basedir} 0 UTF-8 - 8 ${arg.line} - + + junit junit @@ -41,7 +46,8 @@ jnacl 1.0.0 - + + ossrh @@ -53,114 +59,6 @@ - - - org.apache.maven.plugins - maven-compiler-plugin - - - compile-java-8 - - compile - - - - compile-java-16 - compile - - compile - - - 16 - - ${project.basedir}/src/main/java16 - - true - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - false - 5 - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - - jar - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - attach-javadocs - - jar - - - - - - biz.aQute.bnd - bnd-maven-plugin - 7.0.0 - true - - - default-jar - - jar - - - - Bundle-SymbolicName: $[project.groupId].$[project.artifactId] - Export-Package: \ - zmq.*, \ - org.zeromq.* - Import-Package: \ - com.neilalexander.*;resolution:=optional, \ - * - -jpms-module-info: $[Bundle-SymbolicName];access=0 - - - - - - - org.apache.maven.plugins - maven-release-plugin - - v@{project.version} - true - false - release - deploy - - - @@ -365,8 +263,7 @@ true true - ${project.basedir}/src/main/java,${project.basedir}/src/main/java16 - ${project.basedir}/src/checkstyle/checks.xml + ${rootDir}/src/checkstyle/checks.xml true **/guide/* From d18c4b3d5f4bc7bb84513a606335fced46ba2032 Mon Sep 17 00:00:00 2001 From: Spencer Park Date: Sat, 27 Jan 2024 19:38:46 -0800 Subject: [PATCH 7/8] Fix compiler targets --- jeromq-ipc/pom.xml | 2 +- jeromq/pom.xml | 22 ++++++++++++++++++++++ pom.xml | 19 ------------------- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/jeromq-ipc/pom.xml b/jeromq-ipc/pom.xml index 07ede8340..b953b4898 100644 --- a/jeromq-ipc/pom.xml +++ b/jeromq-ipc/pom.xml @@ -13,7 +13,7 @@ ${project.basedir}/.. - 16 + 16 UTF-8 diff --git a/jeromq/pom.xml b/jeromq/pom.xml index 94ac8398b..8c2a83ddd 100644 --- a/jeromq/pom.xml +++ b/jeromq/pom.xml @@ -101,4 +101,26 @@ + + + + jdk8 + + 1.8 + + + ${jdk.target} + ${jdk.target} + + + + jdk9+ + + (1.8,) + + + ${jdk.target} + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index ee49405db..778e8a3c0 100644 --- a/pom.xml +++ b/pom.xml @@ -206,25 +206,6 @@ - - jdk8 - - 1.8 - - - ${jdk.target} - ${jdk.target} - - - - jdk9+ - - (1.8,) - - - ${jdk.target} - - versions From e2043d14e5b92cf8dba8c16310c2788fd01907f8 Mon Sep 17 00:00:00 2001 From: Spencer Park Date: Sat, 27 Jan 2024 20:50:21 -0800 Subject: [PATCH 8/8] Switch to service loader based ipc implementation selector. --- jeromq-ipc/pom.xml | 13 +++++ .../main/java/zmq/io/net/ipc/IpcAddress.java | 33 ------------ .../io/net/ipc/UnixDomainSocketIpcImpl.java | 53 +++++++++++++++++++ .../META-INF/services/zmq.io.net.ipc.IpcImpl | 1 + .../TermEndpointUnixDomainSocketIpcTest.java | 5 ++ .../net/ipc/UnixDomainSocketIpcImplTest.java | 22 ++++++++ .../pair/TestPairUnixDomainSocketIpc.java | 5 ++ .../reqrep/TestReqrepUnixDomainSocketIpc.java | 5 ++ jeromq/pom.xml | 11 ++++ jeromq/src/main/java/zmq/Options.java | 4 -- jeromq/src/main/java/zmq/io/SessionBase.java | 8 +-- jeromq/src/main/java/zmq/io/net/Address.java | 8 +-- .../src/main/java/zmq/io/net/NetProtocol.java | 7 ++- .../src/main/java/zmq/io/net/ipc/IpcImpl.java | 40 ++++++++++++++ .../io/net/ipc/{ => loopback}/IpcAddress.java | 31 +---------- .../net/ipc/{ => loopback}/IpcConnecter.java | 2 +- .../net/ipc/{ => loopback}/IpcListener.java | 2 +- .../net/ipc/loopback/TcpLoopbackIpcImpl.java | 51 ++++++++++++++++++ .../ipc/loopback/TcpLoopbackIpcImplTest.java | 24 +++++++++ 19 files changed, 244 insertions(+), 81 deletions(-) create mode 100644 jeromq-ipc/src/main/java/zmq/io/net/ipc/UnixDomainSocketIpcImpl.java create mode 100644 jeromq-ipc/src/main/resources/META-INF/services/zmq.io.net.ipc.IpcImpl create mode 100644 jeromq-ipc/src/test/java/zmq/TermEndpointUnixDomainSocketIpcTest.java create mode 100644 jeromq-ipc/src/test/java/zmq/io/net/ipc/UnixDomainSocketIpcImplTest.java create mode 100644 jeromq-ipc/src/test/java/zmq/socket/pair/TestPairUnixDomainSocketIpc.java create mode 100644 jeromq-ipc/src/test/java/zmq/socket/reqrep/TestReqrepUnixDomainSocketIpc.java create mode 100644 jeromq/src/main/java/zmq/io/net/ipc/IpcImpl.java rename jeromq/src/main/java/zmq/io/net/ipc/{ => loopback}/IpcAddress.java (79%) rename jeromq/src/main/java/zmq/io/net/ipc/{ => loopback}/IpcConnecter.java (91%) rename jeromq/src/main/java/zmq/io/net/ipc/{ => loopback}/IpcListener.java (96%) create mode 100644 jeromq/src/main/java/zmq/io/net/ipc/loopback/TcpLoopbackIpcImpl.java create mode 100644 jeromq/src/test/java/zmq/io/net/ipc/loopback/TcpLoopbackIpcImplTest.java diff --git a/jeromq-ipc/pom.xml b/jeromq-ipc/pom.xml index b953b4898..10de47d2b 100644 --- a/jeromq-ipc/pom.xml +++ b/jeromq-ipc/pom.xml @@ -23,6 +23,19 @@ jeromq ${project.parent.version} + + + junit + junit + test + + + org.zeromq + jeromq + ${project.parent.version} + test-jar + test + \ No newline at end of file diff --git a/jeromq-ipc/src/main/java/zmq/io/net/ipc/IpcAddress.java b/jeromq-ipc/src/main/java/zmq/io/net/ipc/IpcAddress.java index 2e01abb21..c3f5659dc 100644 --- a/jeromq-ipc/src/main/java/zmq/io/net/ipc/IpcAddress.java +++ b/jeromq-ipc/src/main/java/zmq/io/net/ipc/IpcAddress.java @@ -2,7 +2,6 @@ import java.io.IOException; import java.net.ProtocolFamily; -import java.net.SocketAddress; import java.net.StandardProtocolFamily; import java.net.UnixDomainSocketAddress; import java.nio.file.Files; @@ -12,41 +11,9 @@ import zmq.ZError; import zmq.io.net.Address; -import zmq.io.net.tcp.TcpAddress; public class IpcAddress implements Address.IZAddress { - // TODO unused? - public static class IpcAddressMask extends TcpAddress - { - public IpcAddressMask(String addr, boolean ipv6) - { - super(addr, ipv6); - } - - public boolean matchAddress(SocketAddress addr) - { - return address().equals(addr); - } - } - - public static boolean isIpcAddress(SocketAddress address) - { - return address instanceof UnixDomainSocketAddress; - } - - public static String getAddress(SocketAddress address) - { - assert (isIpcAddress(address)); - var unixDomainSocketAddress = (UnixDomainSocketAddress) address; - return unixDomainSocketAddress.getPath().toString(); - } - - public static boolean isImplementedViaTcpLoopback() - { - return false; - } - private String name; private final UnixDomainSocketAddress address; diff --git a/jeromq-ipc/src/main/java/zmq/io/net/ipc/UnixDomainSocketIpcImpl.java b/jeromq-ipc/src/main/java/zmq/io/net/ipc/UnixDomainSocketIpcImpl.java new file mode 100644 index 000000000..308618431 --- /dev/null +++ b/jeromq-ipc/src/main/java/zmq/io/net/ipc/UnixDomainSocketIpcImpl.java @@ -0,0 +1,53 @@ +package zmq.io.net.ipc; + +import java.net.SocketAddress; +import java.net.UnixDomainSocketAddress; + +import zmq.Options; +import zmq.Own; +import zmq.SocketBase; +import zmq.io.IOThread; +import zmq.io.SessionBase; +import zmq.io.net.Address; +import zmq.io.net.Listener; + +public class UnixDomainSocketIpcImpl implements IpcImpl +{ + @Override + public boolean isImplementedViaTcpLoopback() + { + return false; + } + + @Override + public Address.IZAddress createAddress(String addr) + { + return new IpcAddress(addr); + } + + @Override + public boolean isIpcAddress(SocketAddress address) + { + return address instanceof UnixDomainSocketAddress; + } + + @Override + public String getAddress(SocketAddress address) + { + assert (isIpcAddress(address)); + var unixDomainSocketAddress = (UnixDomainSocketAddress) address; + return unixDomainSocketAddress.getPath().toString(); + } + + @Override + public Own createConnector(IOThread ioThread, SessionBase session, Options options, Address addr, boolean wait) + { + return new IpcConnecter(ioThread, session, options, addr, wait); + } + + @Override + public Listener createListener(IOThread ioThread, SocketBase socket, Options options) + { + return new IpcListener(ioThread, socket, options); + } +} diff --git a/jeromq-ipc/src/main/resources/META-INF/services/zmq.io.net.ipc.IpcImpl b/jeromq-ipc/src/main/resources/META-INF/services/zmq.io.net.ipc.IpcImpl new file mode 100644 index 000000000..e5d16b2cd --- /dev/null +++ b/jeromq-ipc/src/main/resources/META-INF/services/zmq.io.net.ipc.IpcImpl @@ -0,0 +1 @@ +zmq.io.net.ipc.UnixDomainSocketIpcImpl \ No newline at end of file diff --git a/jeromq-ipc/src/test/java/zmq/TermEndpointUnixDomainSocketIpcTest.java b/jeromq-ipc/src/test/java/zmq/TermEndpointUnixDomainSocketIpcTest.java new file mode 100644 index 000000000..a4a8d87a1 --- /dev/null +++ b/jeromq-ipc/src/test/java/zmq/TermEndpointUnixDomainSocketIpcTest.java @@ -0,0 +1,5 @@ +package zmq; + +public class TermEndpointUnixDomainSocketIpcTest extends TermEndpointIpcTest +{ +} diff --git a/jeromq-ipc/src/test/java/zmq/io/net/ipc/UnixDomainSocketIpcImplTest.java b/jeromq-ipc/src/test/java/zmq/io/net/ipc/UnixDomainSocketIpcImplTest.java new file mode 100644 index 000000000..fe236024d --- /dev/null +++ b/jeromq-ipc/src/test/java/zmq/io/net/ipc/UnixDomainSocketIpcImplTest.java @@ -0,0 +1,22 @@ +package zmq.io.net.ipc; + +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +import org.junit.Test; + +public class UnixDomainSocketIpcImplTest +{ + @Test + public void testUnixDomainSocketImplIsSelected() + { + assertThat(IpcImpl.get(), instanceOf(UnixDomainSocketIpcImpl.class)); + } + + @Test + public void testIsImplementedViaTcpLoopback() + { + assertThat(IpcImpl.get().isImplementedViaTcpLoopback(), is(false)); + } +} diff --git a/jeromq-ipc/src/test/java/zmq/socket/pair/TestPairUnixDomainSocketIpc.java b/jeromq-ipc/src/test/java/zmq/socket/pair/TestPairUnixDomainSocketIpc.java new file mode 100644 index 000000000..fe375b60f --- /dev/null +++ b/jeromq-ipc/src/test/java/zmq/socket/pair/TestPairUnixDomainSocketIpc.java @@ -0,0 +1,5 @@ +package zmq.socket.pair; + +public class TestPairUnixDomainSocketIpc extends TestPairIpc +{ +} diff --git a/jeromq-ipc/src/test/java/zmq/socket/reqrep/TestReqrepUnixDomainSocketIpc.java b/jeromq-ipc/src/test/java/zmq/socket/reqrep/TestReqrepUnixDomainSocketIpc.java new file mode 100644 index 000000000..8966174da --- /dev/null +++ b/jeromq-ipc/src/test/java/zmq/socket/reqrep/TestReqrepUnixDomainSocketIpc.java @@ -0,0 +1,5 @@ +package zmq.socket.reqrep; + +public class TestReqrepUnixDomainSocketIpc extends TestReqrepIpc +{ +} diff --git a/jeromq/pom.xml b/jeromq/pom.xml index 8c2a83ddd..6ec8a400b 100644 --- a/jeromq/pom.xml +++ b/jeromq/pom.xml @@ -99,6 +99,17 @@ deploy + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + diff --git a/jeromq/src/main/java/zmq/Options.java b/jeromq/src/main/java/zmq/Options.java index b894314f4..5a37dbb6c 100644 --- a/jeromq/src/main/java/zmq/Options.java +++ b/jeromq/src/main/java/zmq/Options.java @@ -8,7 +8,6 @@ import zmq.io.coder.IEncoder; import zmq.io.mechanism.Mechanisms; import zmq.io.net.SelectorProviderChooser; -import zmq.io.net.ipc.IpcAddress; import zmq.io.net.tcp.TcpAddress; import zmq.io.net.tcp.TcpAddress.TcpAddressMask; import zmq.msg.MsgAllocator; @@ -168,9 +167,6 @@ public class Options // TCP accept() filters public final List tcpAcceptFilters = new ArrayList<>(); - // IPC accept() filters - final List ipcAcceptFilters = new ArrayList<>(); - // Last connected routing id for PEER socket public int peerLastRoutingId = 0; diff --git a/jeromq/src/main/java/zmq/io/SessionBase.java b/jeromq/src/main/java/zmq/io/SessionBase.java index b38cb038b..0aaab5874 100644 --- a/jeromq/src/main/java/zmq/io/SessionBase.java +++ b/jeromq/src/main/java/zmq/io/SessionBase.java @@ -15,7 +15,7 @@ import zmq.io.mechanism.Mechanisms; import zmq.io.net.Address; import zmq.io.net.NetProtocol; -import zmq.io.net.ipc.IpcConnecter; +import zmq.io.net.ipc.IpcImpl; import zmq.io.net.norm.NormEngine; import zmq.io.net.pgm.PgmReceiver; import zmq.io.net.pgm.PgmSender; @@ -309,8 +309,8 @@ public int zapConnect() errno.set(ZError.ECONNREFUSED); return ZError.ECONNREFUSED; } - if (peer.options.type != ZMQ.ZMQ_REP && peer.options.type != ZMQ.ZMQ_ROUTER && - peer.options.type != ZMQ.ZMQ_SERVER) { + if (peer.options.type != ZMQ.ZMQ_REP && peer.options.type != ZMQ.ZMQ_ROUTER + && peer.options.type != ZMQ.ZMQ_SERVER) { errno.set(ZError.ECONNREFUSED); return ZError.ECONNREFUSED; } @@ -536,7 +536,7 @@ private void startConnecting(boolean wait) } break; case ipc: { - IpcConnecter connecter = new IpcConnecter(ioThread, this, options, addr, wait); + Own connecter = IpcImpl.get().createConnector(ioThread, this, options, addr, wait); launchChild(connecter); } break; diff --git a/jeromq/src/main/java/zmq/io/net/Address.java b/jeromq/src/main/java/zmq/io/net/Address.java index 2b5532806..35d8c7825 100644 --- a/jeromq/src/main/java/zmq/io/net/Address.java +++ b/jeromq/src/main/java/zmq/io/net/Address.java @@ -1,11 +1,11 @@ package zmq.io.net; -import zmq.io.net.ipc.IpcAddress; - import java.net.InetSocketAddress; import java.net.ProtocolFamily; import java.net.SocketAddress; +import zmq.io.net.ipc.IpcImpl; + public class Address { public interface IZAddress @@ -62,8 +62,8 @@ public Address(SocketAddress socketAddress) protocol = NetProtocol.tcp; resolved = null; } - else if (IpcAddress.isIpcAddress(socketAddress)) { - this.address = IpcAddress.getAddress(socketAddress); + else if (IpcImpl.get().isIpcAddress(socketAddress)) { + this.address = IpcImpl.get().getAddress(socketAddress); protocol = NetProtocol.ipc; resolved = null; } diff --git a/jeromq/src/main/java/zmq/io/net/NetProtocol.java b/jeromq/src/main/java/zmq/io/net/NetProtocol.java index 993b9de6e..93181accf 100644 --- a/jeromq/src/main/java/zmq/io/net/NetProtocol.java +++ b/jeromq/src/main/java/zmq/io/net/NetProtocol.java @@ -9,8 +9,7 @@ import zmq.SocketBase; import zmq.io.IOThread; import zmq.io.net.Address.IZAddress; -import zmq.io.net.ipc.IpcAddress; -import zmq.io.net.ipc.IpcListener; +import zmq.io.net.ipc.IpcImpl; import zmq.io.net.tcp.TcpAddress; import zmq.io.net.tcp.TcpListener; import zmq.io.net.tipc.TipcListener; @@ -25,7 +24,7 @@ public enum NetProtocol public Listener getListener(IOThread ioThread, SocketBase socket, Options options) { - return new IpcListener(ioThread, socket, options); + return IpcImpl.get().createListener(ioThread, socket, options); } @Override @@ -37,7 +36,7 @@ public void resolve(Address paddr, boolean ipv6) @Override public IZAddress zresolve(String addr, boolean ipv6) { - return new IpcAddress(addr); + return IpcImpl.get().createAddress(addr); } }, diff --git a/jeromq/src/main/java/zmq/io/net/ipc/IpcImpl.java b/jeromq/src/main/java/zmq/io/net/ipc/IpcImpl.java new file mode 100644 index 000000000..78184ce9e --- /dev/null +++ b/jeromq/src/main/java/zmq/io/net/ipc/IpcImpl.java @@ -0,0 +1,40 @@ +package zmq.io.net.ipc; + +import java.net.SocketAddress; +import java.util.Iterator; +import java.util.ServiceLoader; + +import zmq.Options; +import zmq.Own; +import zmq.SocketBase; +import zmq.io.IOThread; +import zmq.io.SessionBase; +import zmq.io.net.Address; +import zmq.io.net.Listener; +import zmq.io.net.ipc.loopback.TcpLoopbackIpcImpl; + +public interface IpcImpl +{ + static IpcImpl get() + { + ServiceLoader loader = ServiceLoader.load(IpcImpl.class); + Iterator implementations = loader.iterator(); + if (implementations.hasNext()) { + return implementations.next(); + } + + return new TcpLoopbackIpcImpl(); + } + + boolean isImplementedViaTcpLoopback(); + + Address.IZAddress createAddress(String addr); + + boolean isIpcAddress(SocketAddress address); + + String getAddress(SocketAddress address); + + Own createConnector(IOThread ioThread, SessionBase session, Options options, Address addr, boolean wait); + + Listener createListener(IOThread ioThread, SocketBase socket, Options options); +} diff --git a/jeromq/src/main/java/zmq/io/net/ipc/IpcAddress.java b/jeromq/src/main/java/zmq/io/net/ipc/loopback/IpcAddress.java similarity index 79% rename from jeromq/src/main/java/zmq/io/net/ipc/IpcAddress.java rename to jeromq/src/main/java/zmq/io/net/ipc/loopback/IpcAddress.java index e163335fa..7cdd8e687 100644 --- a/jeromq/src/main/java/zmq/io/net/ipc/IpcAddress.java +++ b/jeromq/src/main/java/zmq/io/net/ipc/loopback/IpcAddress.java @@ -1,4 +1,4 @@ -package zmq.io.net.ipc; +package zmq.io.net.ipc.loopback; import java.net.Inet4Address; import java.net.Inet6Address; @@ -13,39 +13,10 @@ import zmq.ZMQ; import zmq.io.net.Address; -import zmq.io.net.tcp.TcpAddress; import zmq.util.Utils; public class IpcAddress implements Address.IZAddress { - public static class IpcAddressMask extends TcpAddress - { - public IpcAddressMask(String addr, boolean ipv6) - { - super(addr, ipv6); - } - - public boolean matchAddress(SocketAddress addr) - { - return address().equals(addr); - } - } - - public static boolean isIpcAddress(SocketAddress address) - { - return false; - } - - public static String getAddress(SocketAddress address) - { - throw new IllegalArgumentException("Address is not unix domain socket address."); - } - - public static boolean isImplementedViaTcpLoopback() - { - return true; - } - private String name; private final InetSocketAddress address; diff --git a/jeromq/src/main/java/zmq/io/net/ipc/IpcConnecter.java b/jeromq/src/main/java/zmq/io/net/ipc/loopback/IpcConnecter.java similarity index 91% rename from jeromq/src/main/java/zmq/io/net/ipc/IpcConnecter.java rename to jeromq/src/main/java/zmq/io/net/ipc/loopback/IpcConnecter.java index 717240314..4a4074424 100644 --- a/jeromq/src/main/java/zmq/io/net/ipc/IpcConnecter.java +++ b/jeromq/src/main/java/zmq/io/net/ipc/loopback/IpcConnecter.java @@ -1,4 +1,4 @@ -package zmq.io.net.ipc; +package zmq.io.net.ipc.loopback; import zmq.Options; import zmq.io.IOThread; diff --git a/jeromq/src/main/java/zmq/io/net/ipc/IpcListener.java b/jeromq/src/main/java/zmq/io/net/ipc/loopback/IpcListener.java similarity index 96% rename from jeromq/src/main/java/zmq/io/net/ipc/IpcListener.java rename to jeromq/src/main/java/zmq/io/net/ipc/loopback/IpcListener.java index 450e18f2e..163ec35f6 100644 --- a/jeromq/src/main/java/zmq/io/net/ipc/IpcListener.java +++ b/jeromq/src/main/java/zmq/io/net/ipc/loopback/IpcListener.java @@ -1,4 +1,4 @@ -package zmq.io.net.ipc; +package zmq.io.net.ipc.loopback; import java.net.InetSocketAddress; diff --git a/jeromq/src/main/java/zmq/io/net/ipc/loopback/TcpLoopbackIpcImpl.java b/jeromq/src/main/java/zmq/io/net/ipc/loopback/TcpLoopbackIpcImpl.java new file mode 100644 index 000000000..18cb80419 --- /dev/null +++ b/jeromq/src/main/java/zmq/io/net/ipc/loopback/TcpLoopbackIpcImpl.java @@ -0,0 +1,51 @@ +package zmq.io.net.ipc.loopback; + +import java.net.SocketAddress; + +import zmq.Options; +import zmq.Own; +import zmq.SocketBase; +import zmq.io.IOThread; +import zmq.io.SessionBase; +import zmq.io.net.Address; +import zmq.io.net.Listener; +import zmq.io.net.ipc.IpcImpl; + +public class TcpLoopbackIpcImpl implements IpcImpl +{ + @Override + public boolean isImplementedViaTcpLoopback() + { + return true; + } + + @Override + public Address.IZAddress createAddress(String addr) + { + return new IpcAddress(addr); + } + + @Override + public boolean isIpcAddress(SocketAddress address) + { + return false; + } + + @Override + public String getAddress(SocketAddress address) + { + throw new IllegalArgumentException("Address is not unix domain socket address."); + } + + @Override + public Own createConnector(IOThread ioThread, SessionBase session, Options options, Address addr, boolean wait) + { + return new IpcConnecter(ioThread, session, options, addr, wait); + } + + @Override + public Listener createListener(IOThread ioThread, SocketBase socket, Options options) + { + return new IpcListener(ioThread, socket, options); + } +} diff --git a/jeromq/src/test/java/zmq/io/net/ipc/loopback/TcpLoopbackIpcImplTest.java b/jeromq/src/test/java/zmq/io/net/ipc/loopback/TcpLoopbackIpcImplTest.java new file mode 100644 index 000000000..d8a486ed2 --- /dev/null +++ b/jeromq/src/test/java/zmq/io/net/ipc/loopback/TcpLoopbackIpcImplTest.java @@ -0,0 +1,24 @@ +package zmq.io.net.ipc.loopback; + +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +import org.junit.Test; + +import zmq.io.net.ipc.IpcImpl; + +public class TcpLoopbackIpcImplTest +{ + @Test + public void testTcpLoopbackImplIsSelected() + { + assertThat(IpcImpl.get(), instanceOf(TcpLoopbackIpcImpl.class)); + } + + @Test + public void testIsImplementedViaTcpLoopback() + { + assertThat(IpcImpl.get().isImplementedViaTcpLoopback(), is(true)); + } +}