code: private void disconnect(ZMQ.Socket socket, String eventName){
          String   endpoint = getConnectedEndPoint(eventName);
          if (endpoint!=null) {
              EventList eventList = connectedMap.get(endpoint);
              if (eventList!=null) {
                  socket.unsubscribe(eventName.getBytes());
                  traceZmqSubscription(eventName, false);
                  eventList.remove(eventName);
                  if (eventList.size()==0) {
                      socket.disconnect(endpoint);
                      connectedMap.remove(endpoint);
                  }
              }
          }
      }
docs: ===============================================================