|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
This is a queue output pipe that sends messages through TCP. More...

Classes | |
| class | RawDataInfo |
| A convenience class used to store information about raw data. More... | |
| class | RawDataSender |
| A thread that listens for requests to serialize or discard raw data. More... | |
| class | RawDataServer |
| The thread responsible for waiting for requests for raw data. More... | |
Public Member Functions | |
| void | pushMessage (MessageWrapper msgWrap) |
| void | close () |
| Close all pipes, and tells the thread to stop. | |
| void | run () |
| Continuously checks if there are messages to be sent and sends them. | |
| String | toDOT () |
Package Functions | |
| QueueOutputPipeTCP (String address, int port, String rawDataIP, int rawDataPort) throws UnknownHostException, IOException | |
| Constructor. | |
| QueueOutputPipeTCP (String address, int port) throws UnknownHostException, IOException | |
| Constructor. | |
Private Member Functions | |
| void | init (ObjectOutputStream output, String address, int port, String rawDataIP, int rawDataPort) |
| Initializes the output pipe. | |
Private Attributes | |
| LinkedList< Message > | messages = new LinkedList <Message> () |
| List into which pushed messages should be added, until they are sent. | |
| String | rawDataIP |
| IP address to which recipients should connect to request raw data. | |
| int | rawDataPort |
| Port number on which the pipe should wait for requests for raw data. | |
| boolean | keepGoing = true |
| Used to tell the thread to stop. | |
| ObjectOutputStream | output |
| Output stream to which outgoing messages should be written. | |
| Socket | socket |
| The output socket. | |
| String | name |
| The name of this pipe, used only by QueueOutputPipeTCP.toDOT(). | |
| Integer | rawDataID = 0 |
| The ID incremented each time a message with raw data is sent. | |
| final ReentrantLock | rawDataID_lock = new ReentrantLock() |
| Lock for the rawDataID field. | |
| final ReentrantLock | rawDataInfos_lock = new ReentrantLock() |
| Lock for the rawDataInfos field. | |
| final ReentrantLock | messages_lock = new ReentrantLock() |
| Lock for the messages field. | |
| final Condition | messageReceived = messages_lock.newCondition() |
| Condition used to signal that the messages list is not empty. | |
| HashMap< Integer, RawDataInfo > | rawDataInfos = new HashMap<Integer, RawDataInfo> () |
| For each raw data ID, the information about the corresponding raw data. | |
| RawDataServer | rawDataServer |
| The thread responsible for waiting for requests for raw data. | |
| Thread | myThread |
| The QueueOutputPipeTCP's thread. | |
Static Private Attributes | |
| static String | myThreadName = "QueueOutputPipeTCP" |
| The name of this QueueOutputPipeTCP's thread. | |
This is a queue output pipe that sends messages through TCP.
|
package |
Constructor.
| address | IP address of the recipient |
| port | port number of the recipient |
| rawDataIP | IP address to which recipients should connect to request raw data |
| rawDataPort | port number on which the pipe should wait for requests for raw data |
| IOException | thrown if an I/O error occurs while setting up the connection |
| UnknownHostException | thrown if the provided address does not work |
References init(), rawDataIP, and rawDataPort.

|
package |
Constructor.
Sets the raw data port to \ port + 1 and the raw data IP to "localhost."
| address | IP address of the recipient |
| port | port number of the recipient |
| IOException | thrown if an I/O error occurs while setting up the connection |
| UnknownHostException | thrown if the provided address does not work |
References init().

| void frodo2.communication.tcp.QueueOutputPipeTCP.close | ( | ) |
Close all pipes, and tells the thread to stop.
Implements frodo2.communication.QueueOutputPipeInterface.
References keepGoing, myThread, and rawDataServer.
|
private |
Initializes the output pipe.
| output | output stream to which outgoing messages should be written |
| address | IP address of the recipient (only used by QueueOutputPipeTCP.toDOT()) |
| port | port number of the recipient (only used by QueueOutputPipeTCP.toDOT()) |
| rawDataIP | IP address to which recipients should connect to request raw data |
| rawDataPort | port number on which the pipe should wait for requests for raw data |
References myThread, myThreadName, output, rawDataIP, and rawDataPort.
Referenced by QueueOutputPipeTCP(), and QueueOutputPipeTCP().
| void frodo2.communication.tcp.QueueOutputPipeTCP.pushMessage | ( | MessageWrapper | msgWrap | ) |
Implements frodo2.communication.QueueOutputPipeInterface.
References frodo2.communication.MessageWrapper.getMessage(), messageReceived, messages, and messages_lock.

| void frodo2.communication.tcp.QueueOutputPipeTCP.run | ( | ) |
Continuously checks if there are messages to be sent and sends them.
References frodo2.communication.MessageWithRawData.getHandler(), keepGoing, messageReceived, messages, messages_lock, output, rawDataID, rawDataID_lock, rawDataInfos, rawDataInfos_lock, rawDataIP, rawDataPort, rawDataServer, frodo2.communication.MessageWithRawData.setHandler(), and frodo2.communication.Message.writeExternal().

| String frodo2.communication.tcp.QueueOutputPipeTCP.toDOT | ( | ) |
Implements frodo2.communication.QueueOutputPipeInterface.
References name.
|
private |
|
private |
Condition used to signal that the messages list is not empty.
Referenced by pushMessage(), and run().
|
private |
List into which pushed messages should be added, until they are sent.
Referenced by pushMessage(), and run().
|
private |
Lock for the messages field.
Referenced by pushMessage(), and run().
|
private |
The QueueOutputPipeTCP's thread.
|
staticprivate |
The name of this QueueOutputPipeTCP's thread.
Referenced by init().
|
private |
The name of this pipe, used only by QueueOutputPipeTCP.toDOT().
Referenced by toDOT().
|
private |
|
private |
The ID incremented each time a message with raw data is sent.
Referenced by frodo2.communication.tcp.QueueOutputPipeTCP.RawDataSender.run(), and run().
|
private |
Lock for the rawDataID field.
Referenced by run().
|
private |
For each raw data ID, the information about the corresponding raw data.
Referenced by frodo2.communication.tcp.QueueOutputPipeTCP.RawDataSender.run(), and run().
|
private |
Lock for the rawDataInfos field.
Referenced by frodo2.communication.tcp.QueueOutputPipeTCP.RawDataSender.run(), and run().
|
private |
IP address to which recipients should connect to request raw data.
Referenced by init(), QueueOutputPipeTCP(), and run().
|
private |
Port number on which the pipe should wait for requests for raw data.
Referenced by init(), QueueOutputPipeTCP(), frodo2.communication.tcp.QueueOutputPipeTCP.RawDataServer.RawDataServer(), and run().
|
private |
|
private |
The output socket.