net.i2p.sam
Class SAMStreamSession.v1StreamSender

java.lang.Object
  extended by net.i2p.sam.SAMStreamSession.StreamSender
      extended by net.i2p.sam.SAMStreamSession.v1StreamSender
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
SAMStreamSession

protected class SAMStreamSession.v1StreamSender
extends SAMStreamSession.StreamSender


Constructor Summary
SAMStreamSession.v1StreamSender(I2PSocket s, int id)
           
 
Method Summary
 void run()
           
 void sendBytes(java.io.InputStream in, int size)
          Send bytes through the SAM STREAM session socket sender
 void shutDownGracefully()
          Stop a SAM STREAM session socket sender gracefully: stop the sender thread once all pending data has been sent.
 void stopRunning()
          Stop a SAM STREAM session socket sender thread immediately
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAMStreamSession.v1StreamSender

public SAMStreamSession.v1StreamSender(I2PSocket s,
                                       int id)
                                throws java.io.IOException
Throws:
java.io.IOException
Method Detail

sendBytes

public void sendBytes(java.io.InputStream in,
                      int size)
               throws java.io.IOException
Send bytes through the SAM STREAM session socket sender

Overrides:
sendBytes in class SAMStreamSession.StreamSender
Parameters:
in - Data input stream
size - Count of bytes to send
Throws:
java.io.IOException - if the client didnt provide enough data

stopRunning

public void stopRunning()
Stop a SAM STREAM session socket sender thread immediately

Overrides:
stopRunning in class SAMStreamSession.StreamSender

shutDownGracefully

public void shutDownGracefully()
Stop a SAM STREAM session socket sender gracefully: stop the sender thread once all pending data has been sent.

Overrides:
shutDownGracefully in class SAMStreamSession.StreamSender

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class SAMStreamSession.StreamSender