protected override void AddContainer(Container container) { if (CurrentContainer != null) { throw new NotImplementedException("How come"); } List <int> candidates = new List <int>(Holder.GetCandidateHosts(UtilizationStates.Normal, 0)); var under = Holder.GetCandidateHosts(UtilizationStates.UnderUtilization, 0); candidates.AddRange(under); if (candidates.Count > 0) { CurrentContainer = container; AuctionFactory(candidates); foreach (var id in candidates) { Message m = new CanHaveContainerRequest(id, 0, auction.InstanceId, CurrentContainer.GetContainerPredictedLoadInfo()); CommunicationModule.SendMessage(m); } } else { FailedScheduling(); } }
protected override void SendPullRequest() { _hostState.CurrentAction = HostCurrentAction.Pulling; PullRequest pullRequest = new PullRequest(0, this.MachineId, LoadManager.GetPredictedHostLoadInfo()); CommunicationModule.SendMessage(pullRequest); }
public override void MachineAction() { BidLock = -1; EvacuateMode = false; //inital sleep before push or pull //Thread.Sleep(10*Global.Second); while (Started) { //change to time based on backoff algorithm var bft = GetBackOffTime(); Thread.Sleep(bft); lock (_hostLock) { var s = LoadManager.CheckSystemState(true, MinUtilization, MaxUtilization); //can this be up if (BidLock == -1 && !EvacuateMode) { TryToChangeSystemState(s); } else if (EvacuateMode && BidLock == -1) { if (!SendPushRequest()) { break; } } } } var message = new EvacuationDone(0, this.MachineId); CommunicationModule.SendMessage(message); //Console.WriteLine("Hahahahha"); }
private void HandleInitiateMigration(InitiateMigration message) { //Case Docker if (ContainerTable.ContainerType == ContainersType.D) { var container = ContainerTable.GetContainerById(message.ContainerId) as DockerContainer; var imageId = container.ImageId; var request = new ImageLoadRequest(message.TargetHost, this.MachineId, imageId, message.ContainerId); CommunicationModule.SendMessage(request); } //Case Normal else { Task t = new Task(() => { var container = ContainerTable.GetContainerById(message.ContainerId); ContainerTable.LockContainer(message.ContainerId); container.Checkpoint(this.MachineId); var size = (int)container.GetContainerNeededLoadInfo().CurrentLoad.MemorySize; MigrateContainerRequest request = new MigrateContainerRequest(message.TargetHost, this.MachineId, container, size); CommunicationModule.SendMessage(request); ResetBackOff(); }); t.Start(); } //GlobalEnviromentVariables.ResetCheckRate(); }
private void HandlePushLoadAvailabilityRequest(PushLoadAvailabilityRequest message) { Bid bid; if (_hostState.CurrentAction == HostCurrentAction.None && !_hostState.EvacuationMode && LoadManager.CanITakeLoad(message.NewContainerLoadInfo)) { var load = LoadManager.GetHostLoadInfoAfterContainer(message.NewContainerLoadInfo); var newState = load.CalculateTotalUtilizationState(MinUtilization, MaxUtilization); if (newState == UtilizationStates.OverUtilization) { bid = new AuctionBid(MachineId, false, load, message.AuctionId, message.NewContainerLoadInfo.ContainerId, BidReasons.FullLoad, 0); } else { int pulls = CalculatePullsCount(message.NewContainerLoadInfo.ImageId); bid = new AuctionBid(MachineId, true, load, message.AuctionId, message.NewContainerLoadInfo.ContainerId, BidReasons.ValidBid, pulls); _hostState.CurrentAction = HostCurrentAction.Bidding; _hostState.AuctionId = message.AuctionId; } } else { bid = new AuctionBid(MachineId, false, null, message.AuctionId, message.NewContainerLoadInfo.ContainerId, BidReasons.CantBid, 0); } LoadAvailabilityResponce availabilityResponce = new LoadAvailabilityResponce(message.SenderId, this.MachineId, message.AuctionId, bid); CommunicationModule.SendMessage(availabilityResponce); }
protected override void HandleCanHaveContainerResponce(CanHaveContainerResponce message) { if (message.Bid.AuctionId != inOrderProping.InstanceId) { throw new NotImplementedException("How come"); } if (message.Bid.Valid) { AddContainerRequest request = new AddContainerRequest(message.SenderId, 0, CurrentContainer); CommunicationModule.SendMessage(request); CurrentContainer = null; inOrderProping = null; } else { if (inOrderProping.OpenSession) { TestHostForAContainer(); } else { FailedScheduling(); } } }
public ModulesManager(int maxPacketSize, string receiverHost, int receiverPort, int receiverTimeout, string rpcHost, int rpcPort, int queriesRecomputeTimer, int purgeTimer, RSA rsa, IGossipStrategy gossipStrategy, int gossipTimer, int retryDelay, int maxRetriesCount, ZMI zmi) { Logger.Log("Creating modules..."); _registry = new ExecutorRegistry(); var executor = new Executor(_registry); void AddModule(IModule module) { if (executor.TryAddModule(module)) { return; } Logger.LogError($"Could not add {module.GetType().Name}"); throw new ApplicationException( $"Could not add {module.GetType().Name}, which violates the application"); } Console.WriteLine($"Agent started on {receiverHost}:{receiverPort}\nRPC started on {rpcHost}:{rpcPort}"); AddModule(_timer = new TimerModule(executor)); AddModule(_communication = new CommunicationModule(executor, maxPacketSize, IPAddress.Parse(receiverHost), receiverPort, receiverTimeout)); AddModule(_zmi = new ZMIModule(zmi, rsa, queriesRecomputeTimer, purgeTimer, executor)); AddModule(_rmi = new RMIModule(executor, new ServerPort(rpcHost, rpcPort, ServerCredentials.Insecure))); AddModule(_gossip = new GossipModule(executor, gossipTimer, retryDelay, maxRetriesCount, gossipStrategy)); }
private void HandlePullRequest(PullRequest message, List <int> candidates) { var ncandidates = candidates.Take(calculateCountFromPercent(candidates.Count, TestedHostsCount)).ToList(); // int count = candidates.Count(); Auction pullAuction = CreateAuctionInstance(PullAuctionType, message.SenderId, ncandidates, StrategyActionType.PullAction); foreach (var candidateHostId in ncandidates) { if (candidateHostId == 0) { throw new NotImplementedException(); } PullLoadAvailabilityRequest request = new PullLoadAvailabilityRequest(candidateHostId, this.MachineId, pullAuction.InstanceId, pullAuction.Owner); CommunicationModule.SendMessage(request); } if (_masterState.Auction != null) { throw new NotImplementedException(); } //Auctions.Add(pushAuction); //_masterState.CurrentAction = MasterCurrentAction.PullAuction; _masterState.CurrentHost = message.SenderId; _masterState.Auction = pullAuction; }
private void TestHostForAContainer() { var id = inOrderProping.GetNextCandidate(); Message m = new CanHaveContainerRequest(id, 0, inOrderProping.InstanceId, CurrentContainer.GetContainerPredictedLoadInfo()); CommunicationModule.SendMessage(m); }
protected override void HandlePullRequest(PullRequest message, List <int> candidates) { var ncandidates = candidates.Take((int)TestedHostsCount).ToList(); int instanceId = RandomNumberGenerator.GetInstanceRandomNumber(); // int count = candidates.Count(); MostFullAuction pullAuction = new MostFullAuction(instanceId, message.SenderId, ncandidates, StrategyActionType.PullAction); Console.WriteLine($"\tMaster: Initiate a Pull Auction of Host#{message.SenderId} with #{instanceId}"); foreach (var candidateHostId in ncandidates) { if (candidateHostId == 0) { throw new NotImplementedException(); } PullLoadAvailabilityRequest request = new PullLoadAvailabilityRequest(candidateHostId, this.MachineId, instanceId, pullAuction.Owner); CommunicationModule.SendMessage(request); } if (_currentAuction != null) { throw new NotImplementedException(); } //Auctions.Add(pushAuction); Used = message.SenderId; _currentAuction = pullAuction; }
private void Browse_Click(object sender, RoutedEventArgs e) { // Create OpenFileDialog Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); // Display OpenFileDialog by calling ShowDialog method Nullable <bool> result = dlg.ShowDialog(); // Get the selected file name and display in a TextBox if (result == true) { // Open document string filename = dlg.FileName; string content = File.ReadAllText(filename); wiadomosc.Text = content; //CommunicationModule cm = new CommunicationModule("127.0.0.1", 5555, 5000); //var socket = cm.SetupClient(); //cm.Connect(socket); this.solveRequestMessage = new SolveRequestMessage() { Data = CommunicationModule.ConvertStringToData(content), ProblemType = "DVRP", SolvingTimeout = long.Parse(this.timeoutTextBox.Text) }; this.computationalClient = new ComputationClient("127.0.0.1", 5555, 2000); //BaseNode bn = new BaseNode(); //cm.SendData(bn.SerializeMessage(solveRequestMessage), socket); //cm.CloseSocket(socket); } }
private void HandlePullRequest(ForsmanPullRequest message) { ForsmanLoadAvailabilityResponce responce; if (BidLock == -1) { BidLock = message.SenderId; List <ForsmanBid> bids = new List <ForsmanBid>(); var load = LoadManager.GetPredictedHostLoadInfo(); foreach (var cont in ContainerTable.GetAllContainers()) { var conload = cont.GetContainerPredictedLoadInfo(); var nload = LoadManager.GetHostLoadInfoAWithoutContainer(conload); if (LoadManager.CanITakeLoad(conload)) //&& nload.CalculateTotalUtilizationState(MinUtilization, MaxUtilization) != UtilizationStates.UnderUtilization) { ForsmanBid bid = new ForsmanBid(MachineId, true, nload, message.AuctionId, conload.ContainerId, BidReasons.ValidBid, conload); bids.Add(bid); } } responce = new ForsmanLoadAvailabilityResponce(message.SenderId, this.MachineId, load, true, bids); } else { responce = new ForsmanLoadAvailabilityResponce(message.SenderId, this.MachineId, null, false, null); //Resources are locked in the first place } CommunicationModule.SendMessage(responce); }
public override void HandleLoadAvailabilityResponce(LoadAvailabilityResponce message) { _currentAuction.AddBid(message.HostBid); if (!_currentAuction.OpenSession) { var winner = _currentAuction.GetWinnerBid(); if (winner == null) { Console.WriteLine($"\tMaster: No Winner ---------"); InitiateRejectAction(_currentAuction.Owner, _currentAuction.ActionType); } else { Console.WriteLine($"\tMaster: Winner Is Host #{winner.BiddingHost}"); if (winner.Reason == BidReasons.ValidBid) { } else if (winner.Reason == BidReasons.Evacuate) { //EvacuatingHost = message.SenderId; EvacuatingHosts.Add(message.SenderId); DataHolder.SetUtilization(message.SenderId, UtilizationStates.Evacuating); } else { throw new NotImplementedException("from auction"); } //Here The Difference Exist if (_currentAuction.ActionType == StrategyActionType.PushAction) { InitiateMigration(_currentAuction.Owner, winner.BiddingHost, winner.ContainerId); } else { InitiateMigration(winner.BiddingHost, _currentAuction.Owner, winner.ContainerId); } } //Cancel All Bids foreach (var candidate in _currentAuction.GetAllCandidates()) { if (winner == null || candidate != winner.BiddingHost) { BidCancellationRequest request = new BidCancellationRequest(candidate, this.MachineId, _currentAuction.InstanceId); CommunicationModule.SendMessage(request); Console.WriteLine($"\tMaster: Send cancel to {candidate} on auction {_currentAuction.InstanceId}"); } } Console.WriteLine($"\t Master: Closing Auction #{_currentAuction.InstanceId}"); //Auctions.Remove(currentAuction); _currentAuction = null; if (Used == 0) { throw new NotImplementedException(); } Used = 0; } }
public void Dispose() { if (communicationModule != null) { communicationModule.Dispose(); communicationModule = null; } }
protected override void SendPullRequest() { Console.WriteLine($"I'm Host #{MachineId} and I am pulling a container and I have {ContainerTable.GetContainersCount()} contatiners"); BidLock = 0; PullRequest pullRequest = new PullRequest(0, this.MachineId, LoadManager.GetPredictedHostLoadInfo()); CommunicationModule.SendMessage(pullRequest); }
public void Init(VehicleManager vehicleManager) { this.vehicleManager = vehicleManager; if (Application.isPlaying) { communicationModule = new CommunicationModule(communicationCancellationTokenSource.Token); StartCoroutine(GatherVehiclePopulationData(communicationCancellationTokenSource.Token)); } }
protected void InitiateMigration(int source, int target, int containerId) { //Console.WriteLine($"\n\n ------------------- Initiate Push from {source} to {target} on contianer {containerId} in auction Id = {auctionId}"); //migratedIds.Add(containerId,source); var initMigration = new InitiateMigration(this.MachineId, source, target, containerId); CommunicationModule.SendMessage(initMigration); //Should Release All Locks }
public void Run(IBackgroundTaskInstance taskInstance) { if (taskInstance == null) { Diag.DebugPrint("NetworkChangeTask: taskInstance was null"); return; } NetworkStateChangeEventDetails details = taskInstance.TriggerDetails as NetworkStateChangeEventDetails; // Only restart CCT connection if network connectivity level changes. if (details.HasNewNetworkConnectivityLevel == false) { return; } Diag.DebugPrint("System task - " + taskInstance.Task.Name + " starting ..."); // In this example, the channel name has been hardcoded to lookup the property bag // for any previous contexts. The channel name may be used in more sophisticated ways // in case an app has multiple ControlChannelTrigger objects. string channelId = "channelOne"; if (((IDictionary <string, object>)CoreApplication.Properties).ContainsKey(channelId)) { try { AppContext appContext = null; lock (CoreApplication.Properties) { appContext = ((IDictionary <string, object>)CoreApplication.Properties)[channelId] as AppContext; } if (appContext != null && appContext.CommunicationInstance != null) { CommunicationModule communicationInstance = appContext.CommunicationInstance; // Clear any existing channels, sockets etc. communicationInstance.Reset(); // Create CCT enabled transport. communicationInstance.SetUpTransport(communicationInstance.serverUri, GetType().Name); } } catch (Exception ex) { Diag.DebugPrint("Registering with CCT failed with: " + ex.ToString()); } } else { Diag.DebugPrint("Cannot find AppContext key channelOne"); } Diag.DebugPrint("System task - " + taskInstance.Task.Name + " finished."); }
private void HandlePullLoadAvailabilityRequest(PullLoadAvailabilityRequest message) { Console.WriteLine($"Pull : I'm Host #{MachineId}: I've got message from # {message.SenderId}" + $" for auction # {message.AuctionId}"); Bid bid; if (BidLock == -1 && !EvacuateMode) { ContainerLoadInfo selectedContainerload = GetToBeRemovedContainerLoadInfo(); if (selectedContainerload != null) { var oldstate = LoadManager.GetPredictedHostLoadInfo().CalculateTotalUtilizationState(MinUtilization, MaxUtilization); var load = LoadManager.GetHostLoadInfoAWithoutContainer(selectedContainerload); var newState = load.CalculateTotalUtilizationState(MinUtilization, MaxUtilization); if (oldstate == UtilizationStates.Normal && newState == UtilizationStates.UnderUtilization) { bid = new Bid(MachineId, false, load, message.AuctionId, selectedContainerload.ContainerId, BidReasons.MinimumLoad); } else { var breason = BidReasons.ValidBid; if (oldstate == UtilizationStates.UnderUtilization) { EvacuateMode = true; breason = BidReasons.Evacuate; } bid = new Bid(MachineId, true, load, message.AuctionId, selectedContainerload.ContainerId, breason); BidLock = bid.AuctionId; } Console.WriteLine($"I am Host #{MachineId} I am bidding for AuctionId {bid.AuctionId}"); } else { bid = new Bid(MachineId, false, null, message.AuctionId, -1, BidReasons.Empty); } } else { Console.WriteLine($"I am Host #{MachineId} I am Not I'm not Bidlocked {BidLock}"); bid = new Bid(MachineId, false, null, message.AuctionId, -1, BidReasons.CantBid); } Console.WriteLine($"I am Host #{MachineId} for Pull Auction {message.AuctionId} with {bid.Valid}"); LoadAvailabilityResponce availabilityResponce = new LoadAvailabilityResponce(message.SenderId, this.MachineId, message.AuctionId, bid); // var responce = new GetHostLoadInfoResponce(this.HostId, load); CommunicationModule.SendMessage(availabilityResponce); }
protected override void SendPullRequest() { int total = (int)SimulationSize - 1; var load = LoadManager.GetPredictedHostLoadInfo(); _currentAuction = new ForsmanPullAuction(load, total); BidLock = 0; ForsmanPullRequest m = new ForsmanPullRequest(-1, this.MachineId, load, this.MachineId); CommunicationModule.SendMessage(m); }
private void HandleImageLoadRequest(ImageLoadRequest message) { Task t = new Task(async() => { var table = ContainerTable as DockerContainerTable; await table.LoadImage(message.ImageId); var responce = new ImageLoadResponce(message.SenderId, this.MachineId, message.ContainerId, true); CommunicationModule.SendMessage(responce); }); t.Start(); }
public ComputationalNode(string serverIp, int serverPort, int receivingTimeout) { _logger.Debug("Starting CN"); this.communicationModule = new CommunicationModule(serverIp, serverPort, receivingTimeout); this.CreateProcessingThreads(); this.partialProblemsQueue = new Queue <PartialProblemsMessage>(); this.partialSolutionsQueue = new Queue <SolutionsMessage>(); // this.partialSolutionsQueuePart = new Queue <Solution>(); this.solutionsMessagesList = new List <SolutionsMessage>(); }
private void HandleInitiateMigrationRequest(InitiateMigration message) { var con = ContainerTable.GetContainerById(message.ContainerId); var size = (int)con.GetContainerNeededLoadInfo().CurrentLoad.MemorySize; ContainerTable.LockContainer(con.ContainerId); con.Checkpoint(this.MachineId); MigrateContainerRequest request = new MigrateContainerRequest(message.SenderId, this.MachineId, con, size); CommunicationModule.SendMessage(request); }
private void MigrationContainer(ContainerToHost result) { var con = ContainerTable.GetContainerById(result.ConId); var size = (int)con.GetContainerNeededLoadInfo().CurrentLoad.MemorySize; ContainerTable.LockContainer(con.ContainerId); con.Checkpoint(this.MachineId); MigrateContainerRequest request = new MigrateContainerRequest(result.HostId, this.MachineId, con, size); CommunicationModule.SendMessage(request); }
/// <summary> /// Should Be Optimized for the reasons to add new host or remove one /// </summary> /// <param name="hostId"></param> /// <param name="atype"></param> protected void InitiateRejectAction(int hostId, StrategyActionType atype) { var action = RejectActions.Nothing; switch (atype) { case StrategyActionType.PushAction: if (DataHolder.GetUtilization(hostId) == UtilizationStates.UnderUtilization || DataHolder.GetUtilization(hostId) == UtilizationStates.Normal) { //throw new NotImplementedException("How come"); action = RejectActions.TestWalid; } else if (DataHolder.GetUtilization(hostId) == UtilizationStates.Evacuating) { action = RejectActions.CancelEvacuation; //UpdateSate(hostId, UtilizationStates.UnderUtilization,"Master"); DataHolder.SetUtilization(hostId, UtilizationStates.UnderUtilization); } else if (DataHolder.GetCandidateHosts(UtilizationStates.UnderUtilization, hostId).Count == 0 && DataHolder.GetCandidateHosts(UtilizationStates.Evacuating, hostId).Count == 0) { PowerController.PowerOnHost(); } else { //Should I cancell all evacuations } break; case StrategyActionType.PullAction: //Evacuate Host if (DataHolder.GetCandidateHosts(UtilizationStates.OverUtilization, hostId).Count == 0) { action = RejectActions.Evacuate; //UpdateSate(hostId, UtilizationStates.Evacuating, "Master"); DataHolder.SetUtilization(hostId, UtilizationStates.Evacuating); //evacuating.Add(hostId, DateTime.Now); } break; default: throw new ArgumentOutOfRangeException(); } RejectRequest request = new RejectRequest(hostId, this.MachineId, atype, action); CommunicationModule.SendMessage(request); }
private void HandleLoadAvailabilityResponse(ForsmanLoadAvailabilityResponce message) { _currentAuction.EndWaitFor(message.SenderId, message.OldLoadInfo); if (message.Valid) { foreach (var bid in message.Bids) { _currentAuction.AddBid(bid, MinUtilization, MaxUtilization); } } if (!_currentAuction.OpenSession) { var winner = _currentAuction.GetWinnerBid(); if (winner != null) { WinnerAnnouncementMessage responce = new WinnerAnnouncementMessage(-1, this.MachineId, winner.BiddingHost); CommunicationModule.SendMessage(responce); if (_currentActionType == StrategyActionType.PushAction) { var con = ContainerTable.GetContainerById(winner.ContainerId); var size = (int)con.GetContainerNeededLoadInfo().CurrentLoad.MemorySize; ContainerTable.LockContainer(con.ContainerId); con.Checkpoint(this.MachineId); MigrateContainerRequest request = new MigrateContainerRequest(winner.BiddingHost, this.MachineId, con, size); CommunicationModule.SendMessage(request); } else { InitiateMigration request = new InitiateMigration(this.MachineId, winner.BiddingHost, winner.BiddingHost, winner.ContainerId); CommunicationModule.SendMessage(request); } ResetBackOff(); //_lastDelay = 5; } else //No winner { WinnerAnnouncementMessage responce = new WinnerAnnouncementMessage(-1, this.MachineId, 0); CommunicationModule.SendMessage(responce); MaxUtilization = Global.OtherMaxUtilization; MinUtilization = Global.OtherMinUtilization; IncreaseBackOffTime(); BidLock = -1; //_lastDelay = 5; } _currentAuction = null; } }
protected override void HandlePullRequest(PullRequest message, List <int> candidates) { int instanceId = Helpers.RandomNumberGenerator.GetInstanceRandomNumber(); var inOrderInstance = new InOrderProping(instanceId, message.SenderId, candidates, StrategyActionType.PullAction, null); var candidateHostId = inOrderInstance.GetNextCandidate(); PullLoadAvailabilityRequest request = new PullLoadAvailabilityRequest(candidateHostId, this.MachineId, instanceId, inOrderInstance.Owner); CommunicationModule.SendMessage(request); if (_currentProping != null) { throw new NotImplementedException(); } Used = message.SenderId; _currentProping = inOrderInstance; }
private void HandleMigrateContainerRequest(MigrateContainerRequest message) { Task t = new Task(() => { ContainerTable.AddContainer(message.MigratedContainer.ContainerId, message.MigratedContainer); message.MigratedContainer.Restore(this.MachineId); var responce = new MigrateContainerResponse(message.SenderId, this.MachineId, message.MigratedContainer.ContainerId, true); CommunicationModule.SendMessage(responce); BidLock = -1; ResetBackOff(); }); t.Start(); }
protected override bool SendPushRequest() { var containerLoadInfo = GetToBeRemovedContainerLoadInfo(); if (containerLoadInfo != null) { _hostState.CurrentAction = HostCurrentAction.Pushing; PushRequest m = new PushRequest(0, this.MachineId, LoadManager.GetPredictedHostLoadInfo(), containerLoadInfo); CommunicationModule.SendMessage(m); return(true); } else { return(false); } }
private void HandlePullLoadAvailabilityRequest(PullLoadAvailabilityRequest message) { Bid bid; if (_hostState.CurrentAction == HostCurrentAction.None && !_hostState.EvacuationMode) { ContainerLoadInfo selectedContainerload = GetToBeRemovedContainerLoadInfo(); if (selectedContainerload != null) { var oldstate = LoadManager.GetPredictedHostLoadInfo().CalculateTotalUtilizationState(MinUtilization, MaxUtilization); var load = LoadManager.GetHostLoadInfoAWithoutContainer(selectedContainerload); var newState = load.CalculateTotalUtilizationState(MinUtilization, MaxUtilization); //Comment this condition if (oldstate == UtilizationStates.Normal && newState == UtilizationStates.UnderUtilization) { bid = new AuctionBid(MachineId, false, load, message.AuctionId, -1, BidReasons.MinimumLoad, 0); } else { //try to find how many pulls the target will need !!! var pullsCountRequest = new PullsCountRequest(message.RequestOwner, this.MachineId, selectedContainerload.ImageId); var t = CommunicationModule.RequestData(pullsCountRequest); t.Wait(); var pullsCountResponce = t.Result as PullsCountResponce; bid = new AuctionBid(MachineId, true, load, message.AuctionId, selectedContainerload.ContainerId, BidReasons.ValidBid, pullsCountResponce.PullsCount); _hostState.CurrentAction = HostCurrentAction.Bidding; _hostState.AuctionId = message.AuctionId; } } else { bid = new AuctionBid(MachineId, false, null, message.AuctionId, -1, BidReasons.Empty, 0); } } else { bid = new AuctionBid(MachineId, false, null, message.AuctionId, -1, BidReasons.CantBid, 0); } LoadAvailabilityResponce availabilityResponce = new LoadAvailabilityResponce(message.SenderId, this.MachineId, message.AuctionId, bid); CommunicationModule.SendMessage(availabilityResponce); }