public class TCPS extends cMsgDomainAdapter
Modifier and Type | Field and Description |
---|---|
(package private) java.nio.channels.SocketChannel |
channel
Channel for talking to TCPServer.
|
(package private) java.util.concurrent.locks.Lock |
connectLock
Lock for calling
connect() or disconnect() . |
(package private) java.io.DataOutputStream |
dataOut
Socket output stream associated with channel - sends messages to server.
|
(package private) java.util.concurrent.locks.Lock |
notConnectLock
Lock for calling methods other than
connect() or disconnect() . |
(package private) java.util.concurrent.locks.Lock |
socketLock
Lock to ensure that methods using the socket, write in sequence.
|
(package private) java.lang.String |
tcpServerHost
TCPServer's host.
|
(package private) int |
tcpServerPort
TCPServer's TCP listening port.
|
connected, debug, description, domain, host, name, receiving, shutdownHandler, UDL, UDLremainder
Constructor and Description |
---|
TCPS()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
connect()
Method to connect to the TCPServer from this client.
|
void |
disconnect()
Method to close the connection to the tcpServer.
|
void |
send(cMsgMessage message)
Method to send a message/command to the TCPServer.
|
flush, getCurrentUDL, getDebug, getDescription, getDomain, getHost, getInfo, getName, getServerHost, getServerPort, getShutdownHandler, getUDL, getUDLRemainder, isConnected, isReceiving, monitor, sendAndGet, setDebug, setDescription, setName, setShutdownHandler, setUDL, setUDLRemainder, shutdownClients, shutdownServers, start, stop, subscribe, subscribeAndGet, syncSend, unsubscribe
java.lang.String tcpServerHost
int tcpServerPort
java.nio.channels.SocketChannel channel
java.io.DataOutputStream dataOut
java.util.concurrent.locks.Lock connectLock
connect()
or disconnect()
.java.util.concurrent.locks.Lock notConnectLock
connect()
or disconnect()
.java.util.concurrent.locks.Lock socketLock
public void connect() throws cMsgException
connect
in interface cMsgDomainInterface
connect
in class cMsgDomainAdapter
cMsgException
- if there are problems parsing the UDL or
communication problems with the server(s)public void disconnect()
disconnect
in interface cMsgDomainInterface
disconnect
in class cMsgDomainAdapter
public void send(cMsgMessage message) throws cMsgException
send
in interface cMsgDomainInterface
send
in class cMsgDomainAdapter
message
- message to sendcMsgException
- if there are communication problems with the server;
text is null or blank