*/
@Override
public void executeInstruction(VM vm, ThreadInfo currentThread, Instruction instructionToExecute) {
super.executeInstruction(vm, currentThread, instructionToExecute);
InstanceInvocation ii;
int callerRef;
ElementInfo elementInfo;
int port;
if (JointstatesListener.side == Side.CLIENT) {
// Before Socket.connect()
if ((instructionToExecute instanceof InstanceInvocation) && (instructionToExecute.getAttr() == JointstatesInstructionFactory.connectFlag)) {
ii = (InstanceInvocation) instructionToExecute;
callerRef = ii.getCalleeThis(currentThread);
elementInfo = vm.getHeap().get(callerRef);
port = elementInfo.getIntField("port");
logger.warning("jointstates connect to port " + port);
// Save current state to continue model checking from this point later
// PortCollector.addPort(vm.getSearch().getDepth(), port);
// Reached the next connect() level, backtrack
// vm.getSearch().setIgnoredState(true);
}
}
if (JointstatesListener.side == Side.SERVER) {
// ServerSocket.accept()
if ((instructionToExecute instanceof InstanceInvocation) && (instructionToExecute.getAttr() == JointstatesInstructionFactory.acceptFlag)) {
ii = (InstanceInvocation) instructionToExecute;
callerRef = ii.getCalleeThis(currentThread);
elementInfo = vm.getHeap().get(callerRef);
port = elementInfo.getIntField("port");
logger.warning("jointstates accept on port " + port);
//@formatter:off