|
Smack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamSession
public class InBandBytestreamSession
InBandBytestreamSession class represents an In-Band Bytestream session.
In-band bytestreams are bidirectional and this session encapsulates the streams for both directions.
Note that closing the In-Band Bytestream session will close both streams. If both streams are
closed individually the session will be closed automatically once the second stream is closed.
Use the setCloseBothStreamsEnabled(boolean) method if both streams should be closed
automatically if one of them is closed.
| Constructor Summary | |
|---|---|
protected |
InBandBytestreamSession(Connection connection,
Open byteStreamRequest,
String remoteJID)
Constructor. |
| Method Summary | |
|---|---|
void |
close()
Closes the bytestream session. |
protected void |
closeByLocal(boolean in)
This method is invoked if one of the streams has been closed locally, if an error occurred locally or if the whole session should be closed. |
protected void |
closeByPeer(Close closeRequest)
This method is invoked if a request to close the In-Band Bytestream has been received. |
InputStream |
getInputStream()
Returns the InputStream associated with this session to send data. |
OutputStream |
getOutputStream()
Returns the OutputStream associated with this session to receive data. |
int |
getReadTimeout()
Returns the timeout for read operations of the input stream associated with this session. |
boolean |
isCloseBothStreamsEnabled()
Returns whether both streams should be closed automatically if one of the streams is closed. |
void |
setCloseBothStreamsEnabled(boolean closeBothStreamsEnabled)
Sets whether both streams should be closed automatically if one of the streams is closed. |
void |
setReadTimeout(int timeout)
Sets the specified timeout, in milliseconds. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected InBandBytestreamSession(Connection connection,
Open byteStreamRequest,
String remoteJID)
connection - the XMPP connectionbyteStreamRequest - the In-Band Bytestream open request for this sessionremoteJID - JID of the remote peer| Method Detail |
|---|
public InputStream getInputStream()
BytestreamSession
getInputStream in interface BytestreamSessionpublic OutputStream getOutputStream()
BytestreamSession
getOutputStream in interface BytestreamSessionpublic int getReadTimeout()
BytestreamSession
getReadTimeout in interface BytestreamSessionpublic void setReadTimeout(int timeout)
BytestreamSession
setReadTimeout in interface BytestreamSessiontimeout - the specified timeout, in millisecondspublic boolean isCloseBothStreamsEnabled()
false.
true if both streams will be closed if one of the streams is closed,
false if both streams can be closed independently.public void setCloseBothStreamsEnabled(boolean closeBothStreamsEnabled)
false.
closeBothStreamsEnabled - true if both streams should be closed if one of
the streams is closed, false if both streams should be closed
independently
public void close()
throws IOException
BytestreamSessionClosing the session will also close the input stream and the output stream associated to this session.
close in interface BytestreamSessionIOException - if an error occurs while closing the sessionprotected void closeByPeer(Close closeRequest)
closeRequest - the close request from the remote peer
protected void closeByLocal(boolean in)
throws IOException
IOException - if an error occurs while sending the close request
|
Smack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||