myRid = new ByteIdentifier(Utility.sha1(callee));
sId = new ScopeID();
ByteIdentifier b = new ByteIdentifier(Utility.sha1(myRid.getId()));
sId.addSegment(b);
ItemName receiveData = new ItemName(sId, myRid);
Logger.log("waiting for call...");
client.subscribeItem(receiveData, strategy, null);
event = client.getNextEvent();
Logger.log("incoming call...");
if (event.getType() == EventType.PUBLISHED_DATA) {
msg = event.getDataCopy();
}
otherEndId = new ByteIdentifier(msg);
msgSeqNum++;
client.publishRootScope(b, strategy, null);
ItemName sendData = new ItemName(sId, otherEndId);
Logger.log("Sending response to caller...");
client.publishItem(sendData, strategy, null);
event = client.getNextEvent();