예제 #1
0
파일: Worker.java 프로젝트: ajayj001/ppp
  void openPorts(IbisIdentifier master) throws IOException {
    receiver = parent.ibis.createReceivePort(Rubiks.portType, "worker", this);
    receiver.enableConnections();
    receiver.enableMessageUpcalls();

    sender = parent.ibis.createSendPort(Rubiks.portType);
    sender.connect(master, "master");
  }
예제 #2
0
 public MultiNameResolver(MultiIbis multiIbis, String ibisName) throws IOException {
   this.ibis = multiIbis;
   this.ibisName = ibisName;
   ibis.resolverMap.put(ibisName, this);
   Ibis subIbis = ibis.subIbisMap.get(ibisName);
   requestListenPort = subIbis.createReceivePort(MultiIbis.resolvePortType, resolvePortName);
   requestListenPort.enableConnections();
   replyListenPort = subIbis.createReceivePort(MultiIbis.resolvePortType, replyPortName);
   replyListenPort.enableConnections();
   replyPort = subIbis.createSendPort(MultiIbis.resolvePortType);
   requestPort = subIbis.createSendPort(MultiIbis.resolvePortType);
   if (logger.isDebugEnabled()) {
     logger.debug("Started MultiNameResolver for: " + ibisName);
   }
   ThreadPool.createNew(new RequestHandler(), "Request Listener: " + ibisName);
   ThreadPool.createNew(new ReplyHandler(), "Reply Listener: " + ibisName);
 }
예제 #3
0
파일: Worker.java 프로젝트: ajayj001/ppp
  public void shutdown() throws IOException {
    // Close the ports
    try {
      sender.close();
      receiver.close();
    } catch (ConnectionClosedException e) {
      // do nothing
    }

    // Notify the main thread
    synchronized (this) {
      this.notify();
    }
  }