Package net.i2p.sam

Interface SAMMessageSess

All Superinterfaces:
AutoCloseable, Closeable
All Known Subinterfaces:
Session
All Known Implementing Classes:
PrimarySession, SAMDatagramSession, SAMMessageSession, SAMRawSession, SAMStreamSession, SAMv2StreamSession, SAMv3DatagramSession, SAMv3RawSession, SAMv3StreamSession

interface SAMMessageSess extends Closeable
Base interface for SAMMessageSession, which is the base for v1/v3 datagram and raw sessions. Also implemented by SAMStreamSession.
Since:
0.9.25 pulled from SAMMessageSession
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close a SAM message-based session.
    Get the SAM message-based session Destination.
    int
     
    int
     
    boolean
    sendBytes(String dest, byte[] data, int proto, int fromPort, int toPort)
    Send bytes through a SAM message-based session.
    boolean
    sendBytes(String dest, byte[] data, int proto, int fromPort, int toPort, boolean sendLeaseSet, int sendTags, int tagThreshold, int expiration)
    Send bytes through a SAM message-based session.
    void
    Start a SAM message-based session.
  • Method Details

    • start

      void start()
      Start a SAM message-based session. MUST be called after constructor.
    • close

      void close()
      Close a SAM message-based session.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • getDestination

      Destination getDestination()
      Get the SAM message-based session Destination.
      Returns:
      The SAM message-based session Destination.
    • sendBytes

      boolean sendBytes(String dest, byte[] data, int proto, int fromPort, int toPort) throws DataFormatException, I2PSessionException
      Send bytes through a SAM message-based session.
      Parameters:
      dest - Destination
      data - Bytes to be sent
      Returns:
      True if the data was sent, false otherwise
      Throws:
      DataFormatException - on unknown / bad dest
      I2PSessionException - on serious error, probably session closed
    • sendBytes

      boolean sendBytes(String dest, byte[] data, int proto, int fromPort, int toPort, boolean sendLeaseSet, int sendTags, int tagThreshold, int expiration) throws DataFormatException, I2PSessionException
      Send bytes through a SAM message-based session.
      Throws:
      DataFormatException
      I2PSessionException
      Since:
      0.9.25
    • getListenProtocol

      int getListenProtocol()
    • getListenPort

      int getListenPort()