Class ConnectionPacketLevel


  • public class ConnectionPacketLevel
    extends Connection
    Connection class - used to transfer data trough packets like TCP/IP structure
    • Constructor Detail

      • ConnectionPacketLevel

        public ConnectionPacketLevel​(EndSystem source,
                                     EndSystem destination,
                                     long dataToTransfer,
                                     Event eventOnFinish)
        Connection create
        Parameters:
        source - the source end system
        destination - the destination end system
        dataToTransfer - the amount of data to transfer (in bytes)
        eventOnFinish - the event to be executed after the connection finalization
    • Method Detail

      • getNumPacketsWaitingQueue

        public long getNumPacketsWaitingQueue()
        Returns:
        the numPacketsWaitingQueue
      • getPacketsInTransit

        public java.util.List<Packet> getPacketsInTransit()
        Returns:
        the packetsInTransit
      • isAllPacketsDelivered

        public boolean isAllPacketsDelivered()
        Returns:
        true if all packets from this connection where delivered
      • getAllPacketsInTransit

        public static java.util.List<Packet> getAllPacketsInTransit()
        Returns:
        a list of packets in transit for the current simulation
      • getNumAllPacketsInTransit

        public static int getNumAllPacketsInTransit()
        Returns:
        the number of packets in transit
      • updateConnections

        public static void updateConnections()
        Move the packets that can be moved