Class CloudletReceiveTask

java.lang.Object
org.cloudsimplus.cloudlets.network.CloudletTask
org.cloudsimplus.cloudlets.network.CloudletReceiveTask
All Implemented Interfaces:
Identifiable

public class CloudletReceiveTask extends CloudletTask
Since:
CloudSim Toolkit 1.0 TODO For how long will the task be waiting for packets? The sender task has a defined amount of packets to send, but the receiver doesn't have to know how many packets to wait for. Considering a real distributed app such as a web app, the sender can be a browser and the receiver a web server. In this case, the web server runs indefinitely. However, the simulation has to have a time interval. For instance, it may be simulated the operation of this distributed app for 24 hours. This way, the receiver task could have a specific amount of time to run. In the web app scenario, the web server just keep running, waiting for any client to send packets to it, but it is not required that a client do that. The web app may not be accessed during this time. On other hand, the client may send packets to the server and require a response. It then waits for this response and must have a timeout period, so that the client can: (i) stop waiting a reply, (ii) then move to the next task or finish. Each task has to have a status (such as the Cloudlet itself) to define if it was executed successfully or not. For instance, a CloudletReceiveTask that is waiting to receive a list of packets can be configured to finish after a given timeout without receiving the expected packets. How is the network delay being computed?
Author:
Saurabh Kumar Garg, Manoel Campos da Silva Filho
  • Constructor Details

    • CloudletReceiveTask

      public CloudletReceiveTask(int id, Vm sourceVm)
      Creates a new task.
      Parameters:
      id - id to assign to the task
      sourceVm - Vm from where packets are expected to be received
  • Method Details

    • receivePacket

      public void receivePacket(VmPacket packet)
      Receives a packet sent from a CloudletSendTask and add it to the received packet list.
      Parameters:
      packet - the packet received
    • getPacketsReceived

      public List<VmPacket> getPacketsReceived()
      Returns:
      a read-only list of received packets