| | 203 | ==== (10/5) ==== |
| | 204 | A test implementation of the switch-side handshake was added to the codebase, in a separate package `net.floodlightcontroller.core.misc`. This is a client-side !ChannelHandler/!PipelineFactory that generates switch-side handshake reply messages and ECHO_REPLIES to keepalive pings once it completes the handshake. This will be used as a base for the controller's client components. |
| | 205 | |
| | 206 | Noting initialization, the handler's channel is set manually during client startup: |
| | 207 | {{{ |
| | 208 | /*In client class*/ |
| | 209 | |
| | 210 | OFClientPipelineFactory cfact = new OFClientPipelineFactory(null); |
| | 211 | final ClientBootstrap cb = createClientBootStrap(); |
| | 212 | cb.setPipelineFactory(cfact); |
| | 213 | InetSocketAddress csa = new InetSocketAddress(this.remote, this.port); |
| | 214 | ChannelFuture future = cb.connect(csa); |
| | 215 | |
| | 216 | Channel channel = future.getChannel(); |
| | 217 | cfact.setHandlerChannel(channel); |
| | 218 | }}} |
| | 219 | This can probably be avoided if the handler is implemented as an inner class to the client class that fires up the channel, as in Controller.java. |
| | 220 | |
| | 221 | |