public synchronized void reconnect(final String agentId) throws IOException {
try {
if (inboundSockets.containsKey(agentId)) {
final ZmqConnection conn = inboundSockets.get(agentId);
final Socket socket = conn.getSocket();
socket.disconnect(conn.getZmqUrl().toString());
socket.bind(conn.getZmqUrl().toString());
conn.listen();
} else {
final ZmqConnection socket = new ZmqConnection(
ZMQ.getSocket(org.zeromq.ZMQ.PULL), this);