Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.net.internal.BinaryChannelConnection Class Reference
Inheritance diagram for de.fu_berlin.inf.dpp.net.internal.BinaryChannelConnection:
de.fu_berlin.inf.dpp.net.internal.IByteStreamConnection

List of all members.

Classes

class  IDPool
class  Opcode
class  ReceiverThread

Public Member Functions

 BinaryChannelConnection (JID peer, String connectionID, ByteStream stream, ConnectionMode mode, IByteStreamConnectionListener listener) throws IOException
synchronized void initialize ()
String getConnectionID ()
synchronized boolean isConnected ()
void close ()
ConnectionMode getMode ()
JID getPeer ()
void send (TransferDescription data, byte[] content) throws IOException
String toString ()

Detailed Description

BinaryChannelConnection is a class that encapsulates a bidirectional communication channel between two participants.

The threading requirements of this class are the following:

send() is a reentrant method for sending data. Any number of threads can call it in parallel. Note: The maximum number of concurrent threads is 32 !

Author:
sszuecs
coezbek
srossbach

Constructor & Destructor Documentation

de.fu_berlin.inf.dpp.net.internal.BinaryChannelConnection.BinaryChannelConnection ( JID  peer,
String  connectionID,
ByteStream  stream,
ConnectionMode  mode,
IByteStreamConnectionListener  listener 
) throws IOException

Member Function Documentation

void de.fu_berlin.inf.dpp.net.internal.BinaryChannelConnection.close ( )
String de.fu_berlin.inf.dpp.net.internal.BinaryChannelConnection.getConnectionID ( )

Returns the connection id of this connection.

Returns:
the connection id or null if the connection has no id

Implements de.fu_berlin.inf.dpp.net.internal.IByteStreamConnection.

ConnectionMode de.fu_berlin.inf.dpp.net.internal.BinaryChannelConnection.getMode ( )
JID de.fu_berlin.inf.dpp.net.internal.BinaryChannelConnection.getPeer ( )
synchronized void de.fu_berlin.inf.dpp.net.internal.BinaryChannelConnection.initialize ( )

Initializes the byte stream connection. After the initialization is performed the byte stream connection must be able to send and receive data.

Implements de.fu_berlin.inf.dpp.net.internal.IByteStreamConnection.

synchronized boolean de.fu_berlin.inf.dpp.net.internal.BinaryChannelConnection.isConnected ( )
void de.fu_berlin.inf.dpp.net.internal.BinaryChannelConnection.send ( TransferDescription  data,
byte[]  content 
) throws IOException

If this call returns the data has been send successfully, otherwise an IOException is thrown with the reason why the transfer failed.

Parameters:
dataThe data to be sent.
Exceptions:
IOExceptionif the send failed Send the given data as a blocking operation.

Implements de.fu_berlin.inf.dpp.net.internal.IByteStreamConnection.

String de.fu_berlin.inf.dpp.net.internal.BinaryChannelConnection.toString ( )
 All Classes Namespaces Files Functions Variables Enumerations