Socket connection and has
methods that allow to read and write into the Object streams
created from this connection.
| Modifier and Type | Field and Description |
|---|---|
| private final ObjectInputStream | objInputStream
used to read message objects sent in the socket connection. |
| private final ObjectOutputStream | objOutputStream
used to write message objects into the socket connection. |
| private final Socket | socket
Contains the Socket connection between the Replication master and the slave. |
| Access | Constructor and Description |
|---|---|
| public | SocketConnection(Socket
the socket)Socket object that this class
encapsulates.Constructor creates the streams from the socket object passed as parameter. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | Returns: the data read from the connection.Used to read the object messages that are sent. |
| public void | |
| public void | writeMessage(Object
the data to be written into the connection. message)Used to send the object messages across the socket conection. |
| objInputStream | back to summary |
|---|---|
| private final ObjectInputStream objInputStream used to read message objects sent in the socket connection. | |
| objOutputStream | back to summary |
|---|---|
| private final ObjectOutputStream objOutputStream used to write message objects into the socket connection. | |
| socket | back to summary |
|---|---|
| private final Socket socket Contains the Socket connection between the Replication master and the slave. | |
| SocketConnection | back to summary |
|---|---|
| public SocketConnection(Socket socket) throws IOException Constructor creates the streams from the socket object passed as parameter.
| |
| readMessage | back to summary |
|---|---|
| public Object readMessage() throws ClassNotFoundException, IOException Used to read the object messages that are sent. waits on the input stream until a data is present that can be read and returns this data.
| |
| tearDown | back to summary |
|---|---|
| public void tearDown() throws IOException Closes the
| |
| writeMessage | back to summary |
|---|---|
| public void writeMessage(Object message) throws IOException Used to send the object messages across the socket conection.
| |