Package net.i2p.sam
Interface SAMStreamReceiver
- All Known Implementing Classes:
SAMv1Handler
,SAMv2Handler
,SAMv3Handler
interface SAMStreamReceiver
Interface for sending streaming data to a SAM client
-
Method Summary
Modifier and TypeMethodDescriptionvoid
notifyStreamDisconnection
(int id, String result, String msg) Notify that a connection has been closed FIXME: this interface should be cleanervoid
notifyStreamIncomingConnection
(int id, Destination dest) Notify about a new incoming connectionvoid
notifyStreamOutgoingConnection
(int id, String result, String msg) Notify about a new outgoing connectionvoid
notifyStreamSendBufferFree
(int id) Notifies that the outwards buffer is free for writingvoid
receiveStreamBytes
(int id, ByteBuffer data) Transmit a byte array from I2P to a SAM client.void
Stop receiving data.void
streamSendAnswer
(int id, String result, String bufferState) Sends the result of a stream send operation
-
Method Details
-
streamSendAnswer
Sends the result of a stream send operation- Parameters:
id
- Stream IDresult
- informationbufferState
- state of the buffer- Throws:
IOException
-
notifyStreamSendBufferFree
Notifies that the outwards buffer is free for writing- Parameters:
id
- stream ID- Throws:
IOException
-
notifyStreamIncomingConnection
Notify about a new incoming connection- Parameters:
id
- New connection iddest
- Destination- Throws:
IOException
-
notifyStreamOutgoingConnection
Notify about a new outgoing connection- Parameters:
id
- New connection idresult
- message resultmsg
- Message- Throws:
IOException
-
receiveStreamBytes
Transmit a byte array from I2P to a SAM client.- Parameters:
id
- Connection iddata
- Byte array to be received- Throws:
IOException
-
notifyStreamDisconnection
Notify that a connection has been closed FIXME: this interface should be cleaner- Parameters:
id
- Connection idresult
- Disconnection reason ("OK" or something else)msg
- Error message, if any- Throws:
IOException
-
stopStreamReceiving
void stopStreamReceiving()Stop receiving data.
-