net.i2p.sam

## Class SAMv3DatagramSession

- java.lang.Object
- - net.i2p.sam.SAMMessageSession
  - - net.i2p.sam.SAMDatagramSession
    - - net.i2p.sam.SAMv3DatagramSession

All Implemented Interfaces:
  SAMDatagramReceiver, SAMv3Handler.Session

    public class SAMv3DatagramSession
    extends SAMDatagramSession
    implements SAMv3Handler.Session, SAMDatagramReceiver

### Nested Class Summary

### Nested classes/interfaces inherited from class net.i2p.sam.SAMMessageSession

`SAMMessageSession.SAMMessageSessionHandler`

### Field Summary

Fields
`(package private) SocketAddress` `clientAddress`
`(package private) SAMv3Handler` `handler`
`(package private) String` `nick`
`(package private) SAMv3Handler.DatagramServer` `server`

### Fields inherited from class net.i2p.sam.SAMDatagramSession

`DGRAM_SIZE_MAX, recv`

### Constructor Summary

Constructors
Constructor and Description
`SAMv3DatagramSession(String nick)` build a DatagramSession according to informations registered with the given nickname

### Method Summary

Methods
`String` `getNick()`
`void` `receiveDatagramBytes(Destination sender, byte[] data)` Send a byte array to a SAM client.
`void` `stopDatagramReceiving()` Stop receiving data.

### Methods inherited from class net.i2p.sam.SAMDatagramSession

`messageReceived, sendBytes, shutDown`

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

`close, getDestination, getI2PSession, sendBytesThroughMessageSession`

### 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.SAMv3Handler.Session

`close, sendBytes`

### Field Detail

#### handler

    SAMv3Handler handler

#### server

    SAMv3Handler.DatagramServer server

#### nick

    String nick

#### clientAddress

    SocketAddress clientAddress

### Constructor Detail

#### SAMv3DatagramSession

    public SAMv3DatagramSession(String nick)
                         throws IOException,
                                DataFormatException,
                                I2PSessionException,
                                SAMException

build a DatagramSession according to informations registered with the given nickname

Parameters:
  `nick` - nickname of the session
Throws:
  `IOException`
  `DataFormatException`
  `I2PSessionException`
  `SAMException`

### Method Detail

#### getNick

    public String getNick()

Specified by:
  `getNick` in interface `SAMv3Handler.Session`

#### receiveDatagramBytes

    public void receiveDatagramBytes(Destination sender,
                            byte[] data)
                              throws IOException

Description copied from interface: `SAMDatagramReceiver`
Send a byte array to a SAM client.

Specified by:
  `receiveDatagramBytes` in interface `SAMDatagramReceiver`
Parameters:
  `sender` - Destination
  `data` - Byte array to be received
Throws:
  `IOException`

#### stopDatagramReceiving

    public void stopDatagramReceiving()

Description copied from interface: `SAMDatagramReceiver`
Stop receiving data.

Specified by:
  `stopDatagramReceiving` in interface `SAMDatagramReceiver`