/// <summary> /// Constructs a channel proxy that will be provided to the client module during the setup step execution. /// </summary> public DssChannelProxy(DssMode mode) { this.proxyMode = mode; this.accessDenied = true; this.accessorThread = RCThread.CurrentThread; this.incomingPackages = null; this.outgoingPackages = null; this.currentStateOfChannel = DssChannelState.CHANNEL_CLOSED; this.currentStateOfChannels = null; this.taskToPerform = DssChannelTask.NOT_SPECIFIED; this.guestIndex = -1; /// currently we don't know the index at guest side }
/// <summary> /// Constructs a setup step object. /// </summary> public SetupStep(DssMode mode) { this.mode = mode; this.packageListTmp = new List <RCPackage>(); this.leftList = null; this.lostList = null; this.channelStateList = null; this.beginArrived = false; if (this.mode == DssMode.HOST_SIDE) { this.state = SetupStepState.READY; this.stepID = RandomService.DefaultGenerator.Next(); this.packageList = new RCPackage[0]; } else { this.state = SetupStepState.NOT_FINISHED; this.stepID = 0; this.packageList = null; } }
/// <summary> /// Checks whether the caller thread can access an interface method. /// </summary> /// <returns>True if the access is granted, false if the access is denied.</returns> private bool IsInterfaceAccessGranted(DssMode neededMode) { return(!this.accessDenied && (this.proxyMode == neededMode) && (RCThread.CurrentThread == this.accessorThread)); }