Search in sources :

Example 1 with RemoteAddress

use of services.moleculer.transporter.tcp.RemoteAddress in project moleculer-java by moleculer-java.

the class Transporter method getAddress.

// --- GET SOCKET ADDRESS OF A NODE ---
public RemoteAddress getAddress(String nodeID) {
    NodeDescriptor node = nodes.get(nodeID);
    if (node == null) {
        return null;
    }
    RemoteAddress address;
    node.readLock.lock();
    try {
        address = new RemoteAddress(node.host, node.port);
    } finally {
        node.readLock.unlock();
    }
    return address;
}
Also used : RemoteAddress(services.moleculer.transporter.tcp.RemoteAddress) NodeDescriptor(services.moleculer.transporter.tcp.NodeDescriptor)

Aggregations

NodeDescriptor (services.moleculer.transporter.tcp.NodeDescriptor)1 RemoteAddress (services.moleculer.transporter.tcp.RemoteAddress)1