亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? dynamicschedulerimpl.java.svn-base

?? 網(wǎng)絡(luò)模擬器
?? SVN-BASE
?? 第 1 頁 / 共 2 頁
字號(hào):
        }
        if(receiver == null)
        {
            System.err.println("Trying to send a packet TO a non-existant node: " + receiverIPAddr);
            return;
        }

        //Determine the time to schedule
        double execTime = (System.currentTimeMillis() - m_startTime) / 1000.00;
        //Create the necessary Command object
        PacketSender sendEvent = new PacketSender(sender.getIPHandler(), receiverIPAddr, execTime, data);

        m_simulator.schedule(sendEvent);
    }

    /**
     * Schedules a multicast send on the simulator
     */
    public synchronized void scheduleMulticast(InetAddress senderIPAddress, InetAddress multicastGrp, byte[] data) throws RemoteException
   {
        IPAddr senderIPAddr = new IPAddr(senderIPAddress);
        IPAddr multicastGroup = new IPAddr(multicastGrp);

        // First check that the sender node exists in the simulator
        Node sender = (Node) m_nodes.get(senderIPAddr.toString());
        if(sender == null)
        {
            System.err.println("Trying to multicast a packet FROM a non-existant node: " + senderIPAddr);
            return;
        }
        //Could check that the multicastGroup is a multicast address? Todo perhaps...

        //Determine the time to schedule
        double execTime = (System.currentTimeMillis() - m_startTime) / 1000.00;

        //Create the necessary Command object
        PacketSender sendEvent = new PacketSender(sender.getIPHandler(), multicastGroup, execTime, data);

        m_simulator.schedule(sendEvent);
    }

    /**
     * Receives the next message for the IPAddr indicated, will block if
     * untill there is a message available
     *
     * TODO: return more information that might be required to properly set
     *       a datagram.
     */
    public byte[] receive(InetAddress receiverIPaddr) throws RemoteException
    {
        IPAddr recv = new IPAddr(receiverIPaddr);
        Queue incoming = (Queue) m_msgQueues.get(recv.toString());
        IPPacket ipPacket = null;
        synchronized(incoming)
        {
            try
            {
                while(incoming.size() == 0)
                {
                    incoming.wait();
                }
            }
            catch(InterruptedException e)
            {
                e.printStackTrace();
            }
            ipPacket = (IPPacket) incoming.peekFront();
            incoming.popFront();
        }

        byte[] data = (byte[])ipPacket.data;

        return data;

    }

    /**
     * This method will stop the simulator.
     * TODO: Change this so the simulator does not stop untill all the participants have
     *       called stop()
     */
    public void stop() throws RemoteException
    {
        //Determine the time to schedule
        double execTime = (System.currentTimeMillis() - m_startTime) / 1000.00;
        m_simulator.schedule(new StopCommand(execTime));
    }

    /**
     * This method will start the simulator. This is called by the main() method in this class.
     */
    public synchronized void start()
    {
        new Thread(m_simulator).start();
        m_startTime = (double) System.currentTimeMillis();
        m_started = true;
    }

    //-----------------------------------------
    // The Agent interface functions below here
    //-----------------------------------------
    /**
     * Normally, this would attach a higher level agent to this agent interface. However, as
     * the dynamic scheduler propagates all its packets to external clients, trying to
     * attach a higher level agent does not make any sense.
     * So calling this function will result in a Simulator error.
     *
     */
    public void attach(Agent higher_level, int unique_id)
    {
        Simulator.error("A higher level agent tried to attach itself to the dynamic scheduler. This makes no sense. See documentation.");
    }

    /**
     *
     *   Attach a lower-level agent to this agent. This function is used as a
     *   callback. When a higher-level agent attaches itself to a lower level
     *   agent, the lower level agent will attach itself to the higher-level
     *   agent using this function.<br>
     *   The purpose of this is that the higher-level agent will implement this
     *   function in order to store some reference to the lower-level service
     *   which it can use to give packets to it.<br>
     *   Do NOT call this function as a user of the agent, only agents between
     *   themselves need to use it.
     *
     *   In the dynamic scheduler, this function gets called by the node's
     *   IPHandler when the the dynamic scheduler gets attached to the
     *   IPHandler. This is so that packets can be passed up to the dynamic
     *   scheduler
     *
     * @param lower_level the lower level agent to attach to this agent.
     */
    public void attach(Agent lower_level)
    {
        //Does nothing, as I have a reference to all the IPHandlers through
        //the m_nodes hashmap.
    }

    /**
     Indicate to this agent that a packet is waiting for collection. This
     is used by lower-level agents to indicate to higher-level agents.
     Note that higher-level agents may ignore any of the requests!
     @param status one of the constants defined above.
     @param indicator the object that is indicating, normally an Agent, but
     could be an Interface for example.
     */
    public void indicate(int status, Object indicator)
    {
        if(status == Agent.PACKET_AVAILABLE)
        {
            //It will be a node's IPHandler
            if(indicator instanceof IPHandler)
            {
                //Get the handler
                IPHandler ipHandler = (IPHandler) indicator;
                //Get the IP packet
                IPPacket packet = (IPPacket) ipHandler.read(Protocols.UDP);
                //Determine the destination
                IPAddr addr = ipHandler.getAddress();

                //Add the packet, needs to be synchronized.
                Queue incoming = (Queue) m_msgQueues.get(addr.toString());
                synchronized(incoming)
                {
                    incoming.pushBack(packet);
                    //Need to notify, so that if anyone waiting to receive, will know
                    //it has been updated....
                    incoming.notifyAll();

                }
            }
            else
            {
                Simulator.error("Something other than an IPHandler called indicate() on the DynamicScheduler!");
            }
        }

    }

    /**
     Query this agent if a packet of a given length could be sent. You must
     not call the 'send' function of any agent before calling this function.
     There are two possibilities:
     <ul>
     <li>The function returns 'true' - Go ahead and call 'send'
     <li>The function returns 'false' - In this case you are guaranteed to
     get a READY_TO_SEND indication by the lower level agent you are using.
     Do not try to send any packets but wait for a call to your indicate
     function with that flag set. When you do get that call, you <b>must</b>
     call canSend() again because someone else might take their turn before
     you!
     </ul>
     @param destination where to send the packet to
     @param length the length of the data to be sent
     */
    public boolean canSend(IPAddr destination, int length)
    {
        return false;
    }
    //--------------------------------
    // The main() function below here
    //--------------------------------


    /**
     * This function is an example of how to use the DynamicScheduler.
     */
    public static void main(String[] args)
    {

        try
        {
            //Create the DynamicSchedulerImpl
            DynamicSchedulerImpl scheduler = new DynamicSchedulerImpl("mySimulationRun", 500000, 0.008, 0.0, new IPAddr(255, 255, 255, 0));

            //Add nodes to this simulation run
            scheduler.addNode(new IPAddr(192, 168, 0, 1));
            scheduler.addNode(new IPAddr(192, 168, 0, 2));
            scheduler.addNode(new IPAddr(192, 168, 0, 3));
            /*scheduler.addNode(new IPAddr(192, 168, 0, 4));
            scheduler.addNode(new IPAddr(192, 168, 0, 5));
            scheduler.addNode(new IPAddr(192, 168, 0, 6));
            scheduler.addNode(new IPAddr(192, 168, 0, 7));
            scheduler.addNode(new IPAddr(192, 168, 0, 8));
            scheduler.addNode(new IPAddr(192, 168, 0, 9)); */
            scheduler.addLink(new IPAddr(192, 168, 0, 1), new IPAddr(192, 168, 0, 2));
            /*scheduler.addLink(new IPAddr(192, 168, 0, 1), new IPAddr(192, 168, 0, 3));
            scheduler.addLink(new IPAddr(192, 168, 0, 1), new IPAddr(192, 168, 0, 4));
            scheduler.addLink(new IPAddr(192, 168, 0, 2), new IPAddr(192, 168, 0, 4));
            scheduler.addLink(new IPAddr(192, 168, 0, 3), new IPAddr(192, 168, 0, 4));
            scheduler.addLink(new IPAddr(192, 168, 0, 3), new IPAddr(192, 168, 0, 6));
            scheduler.addLink(new IPAddr(192, 168, 0, 4), new IPAddr(192, 168, 0, 5));
            scheduler.addLink(new IPAddr(192, 168, 0, 4), new IPAddr(192, 168, 0, 6));
            scheduler.addLink(new IPAddr(192, 168, 0, 4), new IPAddr(192, 168, 0, 8));
            scheduler.addLink(new IPAddr(192, 168, 0, 5), new IPAddr(192, 168, 0, 8));
            scheduler.addLink(new IPAddr(192, 168, 0, 5), new IPAddr(192, 168, 0, 9));
            scheduler.addLink(new IPAddr(192, 168, 0, 6), new IPAddr(192, 168, 0, 8));
            scheduler.addLink(new IPAddr(192, 168, 0, 6), new IPAddr(192, 168, 0, 7));
            scheduler.addLink(new IPAddr(192, 168, 0, 8), new IPAddr(192, 168, 0, 7));
            scheduler.addLink(new IPAddr(192, 168, 0, 8), new IPAddr(192, 168, 0, 9));
            //scheduler.addLink(new IPAddr(192, 168, 0, 3), new IPAddr(192, 168, 0, 4));  */
             scheduler.addLink(new IPAddr(192, 168, 0, 2), new IPAddr(192, 168, 0, 3));
            //start the simulation run
            scheduler.start();
            //register the simulation run in the RMIRegistry
            Registry reg = LocateRegistry.createRegistry(3778);
            reg.rebind("DynamicScheduler", scheduler);
            System.out.println("The DynamicScheduler has started.");

        }
        catch(RemoteException e)
        {
            e.printStackTrace();
        }

    }
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产高清在线| 最近中文字幕一区二区三区| 成人综合在线观看| 日韩高清在线观看| 国产精品久久久久四虎| 欧美一区二区在线视频| 99久久精品久久久久久清纯| 麻豆国产精品官网| 一区二区三区四区在线| 久久亚洲影视婷婷| 欧美精选午夜久久久乱码6080| 国产激情视频一区二区三区欧美 | 久久精品一区八戒影视| 色悠悠亚洲一区二区| 国产专区综合网| 午夜久久久久久久久| 中文字幕一区二区三区色视频| 日韩免费一区二区| 91麻豆国产自产在线观看| 免费成人美女在线观看| 一区二区在线观看免费| 国产精品国产三级国产aⅴ无密码| 91麻豆精品国产91| 色吊一区二区三区| 91蜜桃在线免费视频| 国产凹凸在线观看一区二区 | 91丨porny丨户外露出| 国产精品99久久久久久似苏梦涵 | 亚洲国产aⅴ天堂久久| 日韩理论片网站| 国产精品女同互慰在线看| 亚洲精品在线电影| 日韩一级片网址| 欧美电影一区二区| 欧美日韩成人一区二区| 欧美天堂一区二区三区| 一本久道久久综合中文字幕| av电影天堂一区二区在线观看| 福利91精品一区二区三区| 国产精品资源在线看| 国产剧情av麻豆香蕉精品| 久久国产精品露脸对白| 久久国产生活片100| 美女视频免费一区| 久久er精品视频| 久久草av在线| 国产九色sp调教91| 国产呦精品一区二区三区网站| 国产在线精品视频| 国产69精品一区二区亚洲孕妇 | 国产福利不卡视频| 国产成人午夜精品影院观看视频| 激情都市一区二区| 国产成人在线视频网址| 丰满亚洲少妇av| 91在线免费播放| 欧美日韩免费一区二区三区视频| 欧美精三区欧美精三区| 欧美一区二区视频免费观看| 日韩免费高清av| 国产亚洲福利社区一区| 国产精品久久久久久久久免费相片| 久久久精品欧美丰满| 国产精品青草久久| 亚洲一区在线观看视频| 日韩中文字幕av电影| 亚洲综合成人网| 美脚の诱脚舐め脚责91| 国产成人鲁色资源国产91色综| 91小视频在线免费看| 欧美老女人第四色| 91精品国产麻豆国产自产在线| 精品国产乱码久久久久久免费| 国产精品热久久久久夜色精品三区 | 丁香啪啪综合成人亚洲小说 | 欧美日韩国产大片| 日韩精品专区在线影院观看| 久久精品欧美日韩| 伊人开心综合网| 久久99精品国产91久久来源| 成人免费av在线| 欧美日韩三级一区| 日本一区二区在线不卡| 一区二区欧美在线观看| 精久久久久久久久久久| 色久优优欧美色久优优| 日韩精品最新网址| 亚洲日本在线观看| 久久97超碰国产精品超碰| 99国产精品一区| 欧美一区二区三区日韩| 中文字幕亚洲精品在线观看| 青青草国产成人av片免费| 99re8在线精品视频免费播放| 91精品国产欧美一区二区18| 国产精品欧美极品| 奇米亚洲午夜久久精品| 波多野结衣的一区二区三区| 88在线观看91蜜桃国自产| 日韩伦理av电影| 国产精品资源在线观看| 欧美性猛片aaaaaaa做受| 中文字幕精品一区| 久久精品国产成人一区二区三区| 日本韩国精品在线| 国产日产欧美一区二区视频| 亚洲成国产人片在线观看| 成人国产一区二区三区精品| 日韩欧美激情在线| 亚洲国产精品久久久久婷婷884| 国产真实乱对白精彩久久| 欧美性色aⅴ视频一区日韩精品| 国产欧美精品一区| 久久99国产精品免费网站| 欧美三日本三级三级在线播放| 中文字幕av不卡| 韩国精品在线观看| 欧美一区二区三区不卡| 亚洲天堂av老司机| 成人精品视频一区二区三区| 色爱区综合激月婷婷| 国产日韩一级二级三级| 麻豆久久一区二区| 欧美丰满少妇xxxbbb| 一区二区三区日本| 色久综合一二码| 亚洲欧美日韩在线播放| 不卡在线视频中文字幕| 国产欧美精品国产国产专区 | 亚洲日本在线a| 波多野结衣视频一区| 国产欧美日韩在线观看| 九一九一国产精品| 欧美成人精品1314www| 麻豆91在线观看| 91麻豆精品国产91久久久久久 | 国产精品综合网| 久久久久久久久免费| 国产精品资源在线看| 国产清纯白嫩初高生在线观看91 | 一区二区欧美在线观看| 欧美在线一区二区| 亚洲夂夂婷婷色拍ww47| 欧美在线制服丝袜| 亚洲成在人线免费| 欧美电影影音先锋| 免费成人av资源网| 久久久亚洲精品石原莉奈| 国产99久久精品| 国产精品蜜臀av| 色哟哟亚洲精品| 亚洲国产精品嫩草影院| 欧美一级片在线看| 极品销魂美女一区二区三区| 国产亚洲欧美激情| 91视频免费看| 亚洲国产精品久久久久秋霞影院 | 在线观看日韩精品| 午夜欧美电影在线观看| 日韩三级av在线播放| 国产一区二区精品在线观看| 国产精品三级电影| 欧美视频一区二区| 美腿丝袜一区二区三区| 国产日韩精品一区二区三区在线| 欧美日韩在线免费视频| 奇米四色…亚洲| 国产精品视频观看| 在线观看亚洲a| 狂野欧美性猛交blacked| 国产午夜三级一区二区三| 91网站最新网址| 日本最新不卡在线| 久久蜜桃一区二区| 色视频一区二区| 美国毛片一区二区三区| 欧美激情自拍偷拍| 欧美日韩精品二区第二页| 久久精品国产在热久久| 国产精品麻豆久久久| 欧美伦理视频网站| 懂色av一区二区三区免费看| 亚洲一二三级电影| 久久精子c满五个校花| 欧美曰成人黄网| 国产乱国产乱300精品| 一区二区免费在线播放| 久久蜜桃一区二区| 欧美三级韩国三级日本一级| 国产精品一二三区在线| 亚洲6080在线| 国产精品护士白丝一区av| 欧美日韩国产在线观看| 国产999精品久久久久久绿帽| 亚洲观看高清完整版在线观看 | 欧美国产日韩a欧美在线观看| 精品视频999| 91捆绑美女网站| 国产主播一区二区| 日韩成人伦理电影在线观看|