cpw.mods.fml.common.network

## Class FMLEmbeddedChannel

- java.lang.Object
- - io.netty.util.DefaultAttributeMap
  - - io.netty.channel.AbstractChannel
    - - io.netty.channel.embedded.EmbeddedChannel
      - - cpw.mods.fml.common.network.FMLEmbeddedChannel

- All Implemented Interfaces:
    io.netty.channel.Channel, io.netty.util.AttributeMap, java.lang.Comparable<io.netty.channel.Channel>

      public class FMLEmbeddedChannel
      extends io.netty.channel.embedded.EmbeddedChannel

  Utility wrapper around `EmbeddedChannel`. Provides some convenience methods associated with the specific needs of FML network handling.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class io.netty.channel.AbstractChannel

      `io.netty.channel.AbstractChannel.AbstractUnsafe`

    - ### Nested classes/interfaces inherited from interface io.netty.channel.Channel

      `io.netty.channel.Channel.Unsafe`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FMLEmbeddedChannel(ModContainer container, java.lang.String channelName, Side source, io.netty.channel.ChannelHandler... handlers)`
    `FMLEmbeddedChannel(java.lang.String channelName, Side source, io.netty.channel.ChannelHandler... handlers)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `findChannelHandlerNameForType(java.lang.Class<? extends io.netty.channel.ChannelHandler> type)`
    `Packet` | `generatePacketFrom(java.lang.Object object)` Utility method to generate a regular packet from a custom packet.

    - ### Methods inherited from class io.netty.channel.embedded.EmbeddedChannel

      `checkException, config, doBeginRead, doBind, doClose, doDisconnect, doRegister, doWrite, ensureOpen, finish, inboundMessages, isActive, isCompatible, isOpen, lastInboundBuffer, lastOutboundBuffer, localAddress0, metadata, newUnsafe, outboundMessages, readInbound, readOutbound, remoteAddress0, runPendingTasks, writeInbound, writeOutbound`

    - ### Methods inherited from class io.netty.channel.AbstractChannel

      `alloc, bind, bind, checkEOF, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doDeregister, equals, eventLoop, flush, hashCode, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, localAddress, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, remoteAddress, toString, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlush`

    - ### Methods inherited from class io.netty.util.DefaultAttributeMap

      `attr`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface io.netty.util.AttributeMap

      `attr`

- - ### Constructor Detail

    - #### FMLEmbeddedChannel

          public FMLEmbeddedChannel(java.lang.String channelName,
                            Side source,
                            io.netty.channel.ChannelHandler... handlers)

    - #### FMLEmbeddedChannel

          public FMLEmbeddedChannel(ModContainer container,
                            java.lang.String channelName,
                            Side source,
                            io.netty.channel.ChannelHandler... handlers)

  - ### Method Detail

    - #### generatePacketFrom

          public Packet generatePacketFrom(java.lang.Object object)

      Utility method to generate a regular packet from a custom packet. Basically, it writes the packet through the outbound side which should have a message to message codec present (such as `FMLIndexedMessageToMessageCodec`, transforming from mod packets to standard `FMLProxyPacket`s. This is mostly useful in cases where vanilla expects a packet, such as the TileEntity getDescriptionPacket.
      Parameters:
        `object` - The inbound packet
      Returns:
        A Packet suitable for passing to vanilla network code.

    - #### findChannelHandlerNameForType

          public java.lang.String findChannelHandlerNameForType(java.lang.Class<? extends io.netty.channel.ChannelHandler> type)