Floodlight in Channelpipeline Map

Source: Internet
Author: User

We know that in the Netty architecture, a serverbootstrap used to generate a channel on the server side requires a channelpipelinefactory type of reference to serve the channel that establishes the connection, The pipeline processes requests from a client. So the openflowpipelinefactory here is floodlight to create the channelpipeline for the OpenFlow switch that establishes the connection.





1. Idlestatehandler a idlestateevent event when the channel does not run the corresponding read-write operation for a certain time;2. Readtimeouthandler read timeout processing;3. Handshaketimeouthandler Set a timer to check the status of the connection, the handshake phase. 4. Ofchannelhandler Core, handle all the business.
the code is as follows: Public classopenflowpipelinefactoryImplementsChannelpipelinefactory {
    protectedControllerController ;    protectedThreadpoolexecutorPipelineexecutor ;    protectedTimerTimer;    protectedIdlestatehandlerIdlehandler ;    protectedReadtimeouthandlerReadtimeouthandler ;        PublicOpenflowpipelinefactory (Controller controller,threadpoolexecutor Pipelineexecutor) {        Super ();         This .Controller= Controller;         This .Pipelineexecutor= Pipelineexecutor;         This .Timer = NewHashedwheeltimer ();         This .Idlehandler = NewIdlestatehandler ( Timer , 0);         This .Readtimeouthandler= NewReadtimeouthandler (Timer, (+ );     }     @Override     Publicchannelpipeline getpipeline ()throws Exception { ofchannelstate state =New ofchannelstate ();         Channelpipeline pipeline = Channels. Pipeline ();Pipeline.addlast ("Ofmessagedecoder" , New Ofmessagedecoder ());Pipeline.addlast ("Ofmessageencoder" , NewOfmessageencoder ());Pipeline.addlast ("Idle" , Idlehandler);Pipeline.addlast ( "Timeout" , Readtimeouthandler);Pipeline.addlast ("Handshaketimeout" ,                         New Handshaketimeouthandler (state, Timer,));        if (Pipelineexecutor!= NULL)Pipeline.addlast ( "Pipelineexecutor" ,                             New Executionhandler ( Pipelineexecutor ));        //ofchannelhandler is the core pipeline.addlast ( "Handler" , controller . Getchannelhandler (state));         return pipeline;     }}



Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.

Floodlight in Channelpipeline Map

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.