java.lang.Object
net.i2p.sam.SAMv3DatagramServer.MessageDispatcher
All Implemented Interfaces:
Runnable
Enclosing class:
SAMv3DatagramServer

private static class SAMv3DatagramServer.MessageDispatcherextends Object implements Runnable
Thread handling one received datagram.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final ByteArrayInputStream
    Stream reading the received message lines.
    private static final int
    Longest message line accepted.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MessageDispatcher(byte[] buf)
    Holds one received datagram for parsing and dispatch.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    run()
    Parses one datagram's SAM header and hands the packet to its session.
    private static void
    Logs a warning to the router log.
    private static void
    Log a warning with its cause.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • MessageDispatcher

      public MessageDispatcher(byte[] buf)
      Holds one received datagram for parsing and dispatch.
      Parameters:
      buf - the bytes of the received datagram
  • Method Details

    • run

      public void run()
      Parses one datagram's SAM header and hands the packet to its session.
      Specified by:
      run in interface Runnable
    • warn

      private static void warn(String s)
      Logs a warning to the router log.
      Parameters:
      s - the message to log
    • warn

      private static void warn(String s, Throwable t)
      Log a warning with its cause.
      Parameters:
      s - the message to log
      t - the cause, null if none