java.lang.Object
net.i2p.sam.SAMStreamSession.StreamSender
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
SAMStreamSession.V1StreamSender, SAMv2StreamSession.V2StreamSender
- Enclosing class:
SAMStreamSession
Field Summary
Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionabstract voidrun()Writes the sender's queued payloads to the peer; each subclass implements it.abstract voidsendBytes(InputStream in, int size) Send bytes through the SAM STREAM session socket sender.abstract voidStop a SAM STREAM session socket sender gracefully: stop the sender thread once all pending data has been sent.abstract voidStop a SAM STREAM session socket sender thread immediately.
Field Details
_id
protected final int _idStream id assigned by the client for this sender.i2pSocket
i2pSocket.
Constructor Details
StreamSender
Create a new StreamSender.- Parameters:
s- the I2PSocket to write toid- the stream id- Throws:
IOException- if the output stream cannot be obtained
Method Details
sendBytes
Send bytes through the SAM STREAM session socket sender.- Parameters:
in- Data input streamsize- Count of bytes to send- Throws:
IOException- if the client didnt provide enough data
stopRunning
public abstract void stopRunning()Stop a SAM STREAM session socket sender thread immediately.shutDownGracefully
public abstract void shutDownGracefully()Stop a SAM STREAM session socket sender gracefully: stop the sender thread once all pending data has been sent.run