## net.i2p.router.transport.tcp
Class MessageHandler

    java.lang.Object
      net.i2p.router.transport.tcp.MessageHandler

All Implemented Interfaces:
  I2NPMessageReader.I2NPMessageEventListener

    public class MessageHandler

extends java.lang.Object
implements I2NPMessageReader.I2NPMessageEventListener

Receive messages from a message reader and bounce them off to the transport for further enqueueing.

Constructor Summary
`MessageHandler(TCPTransport transport, TCPConnection con)`

Method Summary
`void` `disconnected(I2NPMessageReader reader)` Notify the listener that the stream the given reader was running off closed
`void` `messageReceived(I2NPMessageReader reader, I2NPMessage message, long msToRead, int size)` Notify the listener that a message has been received from the given reader
`void` `readError(I2NPMessageReader reader, java.lang.Exception error)` Notify the listener that an exception was thrown while reading from the given reader

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MessageHandler

    public MessageHandler(TCPTransport transport,
                          TCPConnection con)

Method Detail

### disconnected

    public void disconnected(I2NPMessageReader reader)

  Description copied from interface: `I2NPMessageReader.I2NPMessageEventListener`
  Notify the listener that the stream the given reader was running off closed

  Specified by:
    `disconnected` in interface `I2NPMessageReader.I2NPMessageEventListener`

### messageReceived

    public void messageReceived(I2NPMessageReader reader,
                                I2NPMessage message,
                                long msToRead,
                                int size)

  Description copied from interface: `I2NPMessageReader.I2NPMessageEventListener`
  Notify the listener that a message has been received from the given reader

  Specified by:
    `messageReceived` in interface `I2NPMessageReader.I2NPMessageEventListener`

### readError

    public void readError(I2NPMessageReader reader,
                          java.lang.Exception error)

  Description copied from interface: `I2NPMessageReader.I2NPMessageEventListener`
  Notify the listener that an exception was thrown while reading from the given reader

  Specified by:
    `readError` in interface `I2NPMessageReader.I2NPMessageEventListener`