net.i2p.sam

## Class SAMv3RawSession

- java.lang.Object
- - net.i2p.sam.SAMMessageSession
  - - net.i2p.sam.SAMRawSession
    - - net.i2p.sam.SAMv3RawSession

- All Implemented Interfaces:
    Closeable, AutoCloseable, SAMMessageSess, SAMRawReceiver, Session

      class SAMv3RawSession
      extends SAMRawSession
      implements Session, SAMRawReceiver

  SAM v3 raw session implementation.

- - ### Field Summary

    - ### Fields inherited from class net.i2p.sam.SAMRawSession

      `RAW_SIZE_MAX, recv`

    - ### Fields inherited from class net.i2p.sam.SAMMessageSession

      `_isOwnSession, _log`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SAMv3RawSession(String nick, Properties props, SAMv3Handler handler, I2PSession isess, int listenProtocol, int listenPort, SAMv3DatagramServer dgServer)` Build a Raw Session on an existing i2p session registered with the given nickname Caller MUST call start().
    `SAMv3RawSession(String nick, SAMv3DatagramServer dgServer)` Build a Raw Datagram Session according to information registered with the given nickname Caller MUST call start().

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getNick()`
    `(package private) static SocketAddress` | `getSocketAddress(Properties props, SAMv3Handler handler)`
    `void` | `receiveRawBytes(byte[] data, int proto, int fromPort, int toPort)` Send a byte array to a SAM client, without informations regarding the sender.
    `void` | `stopRawReceiving()` Stop receiving data.

    - ### Methods inherited from class net.i2p.sam.SAMRawSession

      `messageReceived, sendBytes, sendBytes, shutDown`

    - ### Methods inherited from class net.i2p.sam.SAMMessageSession

      `close, getDestination, getI2PSession, getListenPort, getListenProtocol, sendBytesThroughMessageSession, sendBytesThroughMessageSession, start`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface net.i2p.sam.SAMMessageSess

      `close, getDestination, getListenPort, getListenProtocol, sendBytes, sendBytes, start`

- - ### Constructor Detail

    - #### SAMv3RawSession

          public SAMv3RawSession(String nick,
                                 Properties props,
                                 SAMv3Handler handler,
                                 I2PSession isess,
                                 int listenProtocol,
                                 int listenPort,
                                 SAMv3DatagramServer dgServer)
                          throws IOException,
                                 DataFormatException,
                                 I2PSessionException

      Build a Raw Session on an existing i2p session registered with the given nickname Caller MUST call start().
      Parameters:
        `nick` - nickname of the session
      Throws:
        `IOException`
        `DataFormatException`
        `I2PSessionException`

    - #### SAMv3RawSession

          public SAMv3RawSession(String nick,
                                 SAMv3DatagramServer dgServer)
                          throws IOException,
                                 DataFormatException,
                                 I2PSessionException

      Build a Raw Datagram Session according to information registered with the given nickname Caller MUST call start().
      Parameters:
        `nick` - nickname of the session
      Throws:
        `IOException`
        `DataFormatException`
        `I2PSessionException`

  - ### Method Detail

    - #### getNick

          public String getNick()

      Specified by:
        `getNick` in interface `Session`

    - #### getSocketAddress

          static SocketAddress getSocketAddress(Properties props,
                                                SAMv3Handler handler)

      Returns:
        null if PORT not set

    - #### receiveRawBytes

          public void receiveRawBytes(byte[] data,
                                      int proto,
                                      int fromPort,
                                      int toPort)
                               throws IOException

      Description copied from interface: `SAMRawReceiver`
      Send a byte array to a SAM client, without informations regarding the sender.
      Specified by:
        `receiveRawBytes` in interface `SAMRawReceiver`
      Parameters:
        `data` - Byte array to be received
        `proto` - I2CP protocol
        `fromPort` - I2CP from port
        `toPort` - I2CP to port
      Throws:
        `IOException`

    - #### stopRawReceiving

          public void stopRawReceiving()

      Description copied from interface: `SAMRawReceiver`
      Stop receiving data.
      Specified by:
        `stopRawReceiving` in interface `SAMRawReceiver`