public abstract class BaseMessageSender extends Object implements IMessageSender
Modifier and Type | Field and Description |
---|---|
protected Object |
m_ackLock |
protected Socket |
m_clientSocket |
protected BufferedReader |
m_inReader
Used to receive ACK and STOP
|
protected InputStream |
m_inStream
Incoming message stream.
|
protected OutputStream |
m_outStream
Outgoing message stream.
|
Constructor and Description |
---|
BaseMessageSender(String host,
int port,
boolean ack) |
Modifier and Type | Method and Description |
---|---|
void |
connect()
Starts the connection.
|
void |
initReceiver()
Initialize the receiver.
|
void |
sendAck() |
void |
sendStop() |
void |
shutDown() |
protected void |
waitForAck() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
receiveMessage, sendMessage
protected Socket m_clientSocket
protected Object m_ackLock
protected OutputStream m_outStream
protected volatile InputStream m_inStream
protected volatile BufferedReader m_inReader
public BaseMessageSender(String host, int port, boolean ack)
public void connect() throws IOException
connect
in interface IMessageSender
TestNGException
- if an exception occurred while establishing the connectionIOException
public void sendAck()
sendAck
in interface IMessageSender
public void sendStop()
sendStop
in interface IMessageSender
public void initReceiver() throws SocketTimeoutException
IMessageSender
initReceiver
in interface IMessageSender
SocketTimeoutException
public void shutDown()
shutDown
in interface IMessageSender
protected void waitForAck()
Copyright © 2015. All rights reserved.