public class TCPClientConnection
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
fActive |
int |
fBytesIn |
int |
fBytesOut |
java.net.Socket |
fConnection |
java.io.InputStream |
fInput |
protected boolean |
fIsConnected |
IncomingTCPClientConnectionPacket |
fLastIncomingPacket |
MessageCollectorTCPClientConnectionPacket |
fLastMessageCollectorPacket |
OutgoingTCPClientConnectionPacket |
fLastOugoingPacket |
ExtasysTCPServer |
fMyExtasysServer |
TCPClientConnectionMessageCollector |
fMyMessageCollector |
java.io.OutputStream |
fOutput |
protected boolean |
fUseMessageCollector |
Constructor and Description |
---|
TCPClientConnection(java.net.Socket socket,
TCPListener myTCPListener,
boolean useMessageCollector,
java.lang.String ETX) |
Modifier and Type | Method and Description |
---|---|
void |
DisconnectMe()
Disconnect this client.
|
int |
getBytesIn()
Return number of bytes received from this client.
|
int |
getBytesOut()
Return number of bytes sent from this client.
|
java.util.Date |
getConnectionStartUpDateTime()
Return connection start up Date-Time.
|
java.lang.String |
getIPAddress()
Return client's IP Address.
|
ExtasysTCPServer |
getMyExtasysTCPServer()
Returns the reference of the Extasys TCP Server of this client.
|
TCPClientConnectionMessageCollector |
getMyMessageCollector()
Returns the message collector of this client.
|
TCPListener |
getMyTCPListener()
Returns the reference of the TCP Listener of this client.
|
java.lang.String |
getName()
Return the client's name.
|
java.lang.Object |
getTag()
Return client's tag.
|
boolean |
isActive() |
void |
SendData(byte[] bytes,
int offset,
int length)
Send data to client.
|
void |
SendData(java.lang.String data)
Send data to client.
|
void |
setName(java.lang.String name)
Set the client's name.
|
void |
setTag(java.lang.Object tag)
Set client's tag.
|
public java.net.Socket fConnection
protected boolean fActive
protected boolean fIsConnected
public ExtasysTCPServer fMyExtasysServer
public java.io.InputStream fInput
public java.io.OutputStream fOutput
public int fBytesIn
public int fBytesOut
public TCPClientConnectionMessageCollector fMyMessageCollector
protected boolean fUseMessageCollector
public IncomingTCPClientConnectionPacket fLastIncomingPacket
public OutgoingTCPClientConnectionPacket fLastOugoingPacket
public MessageCollectorTCPClientConnectionPacket fLastMessageCollectorPacket
public TCPClientConnection(java.net.Socket socket, TCPListener myTCPListener, boolean useMessageCollector, java.lang.String ETX)
public void SendData(java.lang.String data) throws ClientIsDisconnectedException, OutgoingPacketFailedException
data
- is the string to send.ClientIsDisconnectedException
OutgoingPacketFailedException
public void SendData(byte[] bytes, int offset, int length) throws ClientIsDisconnectedException, OutgoingPacketFailedException
bytes
- is the byte array to be send.offset
- is the position in the data buffer at witch to begin sending.length
- is the number of the bytes to be send.ClientIsDisconnectedException
OutgoingPacketFailedException
public void DisconnectMe()
public TCPListener getMyTCPListener()
public ExtasysTCPServer getMyExtasysTCPServer()
public java.lang.String getIPAddress()
public java.lang.String getName()
public void setName(java.lang.String name)
name
- is the client's name.public java.util.Date getConnectionStartUpDateTime()
public void setTag(java.lang.Object tag)
tag.
- public java.lang.Object getTag()
public int getBytesIn()
public int getBytesOut()
public boolean isActive()
public TCPClientConnectionMessageCollector getMyMessageCollector()