FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.communication.tcp.RawDataHandlerTCP Class Reference

A raw data handler that works with TCP. More...

Inheritance diagram for frodo2.communication.tcp.RawDataHandlerTCP:

Public Member Functions

 RawDataHandlerTCP (Integer rawDataID, String rawDataIP, int rawDataPort)
 Constructor.
synchronized ObjectInputStream requestRawData ()
 Gets the raw data.
synchronized void discardRawData ()
 Tells the sender to discard the raw data.

Protected Member Functions

void finalize () throws Throwable
 Closes the socket.

Private Member Functions

void readObject (java.io.ObjectInputStream in) throws IOException, ClassNotFoundException
 This is the method called when deserializing a RawDataHandlerTCP.

Private Attributes

Integer rawDataID = null
 ID of the raw data.
String rawDataIP
 IP from which the raw data can be retrieved.
int rawDataPort
 Port number from which the raw data can be retrieved.
transient Socket socket
 Socket used to communicate with the sender of the raw data.
transient ObjectOutputStream toSender
 Output stream used to send requests to the sender of the message.

Static Private Attributes

static final long serialVersionUID = 9055544029313537503L
 Used for serialization.

Detailed Description

A raw data handler that works with TCP.

Author
Thomas Leaute

Constructor & Destructor Documentation

◆ RawDataHandlerTCP()

frodo2.communication.tcp.RawDataHandlerTCP.RawDataHandlerTCP ( Integer rawDataID,
String rawDataIP,
int rawDataPort )

Constructor.

Parameters
rawDataIDID of the raw data
rawDataIPIP from which the raw data can be retrieved
rawDataPortPort number from which the raw data can be retrieved

References rawDataID, rawDataIP, and rawDataPort.

Member Function Documentation

◆ discardRawData()

synchronized void frodo2.communication.tcp.RawDataHandlerTCP.discardRawData ( )

◆ finalize()

void frodo2.communication.tcp.RawDataHandlerTCP.finalize ( ) throws Throwable
protected

Closes the socket.

See also
java.lang.Object#finalize()

References socket.

◆ readObject()

void frodo2.communication.tcp.RawDataHandlerTCP.readObject ( java.io.ObjectInputStream in) throws IOException, ClassNotFoundException
private

This is the method called when deserializing a RawDataHandlerTCP.

Establishes the connection with the sender of the raw data.

Parameters
inthe stream from which the message is read
Exceptions
ClassNotFoundExceptionthrown if the class read from the stream is unknown
IOExceptionthrown if an I/O error occurs

References frodo2.java, rawDataID, rawDataIP, rawDataPort, socket, and toSender.

◆ requestRawData()

synchronized ObjectInputStream frodo2.communication.tcp.RawDataHandlerTCP.requestRawData ( )

Gets the raw data.

The first time this method is called, it sends a request for the raw data and returns a stream from which it can be read. It returns null if any exception occurs in the process, or this is not the first time the method is called.

See also
frodo2.communication.MessageWithRawData.RawDataHandler.requestRawData()

Implements frodo2.communication.MessageWithRawData.RawDataHandler.

References rawDataID, socket, and toSender.

Member Data Documentation

◆ rawDataID

Integer frodo2.communication.tcp.RawDataHandlerTCP.rawDataID = null
private

ID of the raw data.

Referenced by discardRawData(), RawDataHandlerTCP(), readObject(), and requestRawData().

◆ rawDataIP

String frodo2.communication.tcp.RawDataHandlerTCP.rawDataIP
private

IP from which the raw data can be retrieved.

Referenced by RawDataHandlerTCP(), and readObject().

◆ rawDataPort

int frodo2.communication.tcp.RawDataHandlerTCP.rawDataPort
private

Port number from which the raw data can be retrieved.

Referenced by RawDataHandlerTCP(), and readObject().

◆ serialVersionUID

final long frodo2.communication.tcp.RawDataHandlerTCP.serialVersionUID = 9055544029313537503L
staticprivate

Used for serialization.

◆ socket

transient Socket frodo2.communication.tcp.RawDataHandlerTCP.socket
private

Socket used to communicate with the sender of the raw data.

Referenced by finalize(), readObject(), and requestRawData().

◆ toSender

transient ObjectOutputStream frodo2.communication.tcp.RawDataHandlerTCP.toSender
private

Output stream used to send requests to the sender of the message.

Referenced by discardRawData(), readObject(), and requestRawData().


The documentation for this class was generated from the following file: