public class SocketClientCommunication extends Object implements ClientCommunicationInterface
Constructor and Description |
---|
SocketClientCommunication(ServerSocketInterface2 serverSocket,
ISocket cs)
The instance of this class is created by the client connection listener.
|
Modifier and Type | Method and Description |
---|---|
boolean |
close()
Closes the current socket connection to the client.
|
String |
getClientDNSName()
Gets the DNS name of this client connection.
|
InetAddress |
getClientInetAddress()
Gets the address of the client or null if not connected.
|
String |
getClientIPAddress()
Gets the IP address of this client connection (as 1.2.3.4),
or return "0.0.0.0" if disconnected and the address never has been retrieved.
|
InetAddress |
getServerInetAddress()
Gets the address of the server or null if not connected.
|
ServerSocketInterface2 |
getServerSocket()
Gets the server socket interface associated with the accept of this socket.
|
ISocket |
getSocket()
Gets socket associated with this communication.
|
void |
hardClose()
Hard-closes the current socket connection to the client.
|
byte[] |
receiveTransaction()
Reads a transaction from the client.
|
byte[] |
receiveTransaction(Object[] isCompressed)
Reads a transaction from the client.
|
void |
sendTransaction(byte[] data)
Sends a transaction to the client.
|
void |
sendTransaction(byte[] data,
int type)
Sends a transaction to the client.
|
public SocketClientCommunication(ServerSocketInterface2 serverSocket, ISocket cs) throws IOException
IOException
public InetAddress getClientInetAddress()
getClientInetAddress
in interface ClientCommunicationInterface
public InetAddress getServerInetAddress()
getServerInetAddress
in interface ClientCommunicationInterface
public String getClientDNSName()
getClientDNSName
in interface SocketNameInterface
public String getClientIPAddress()
getClientIPAddress
in interface SocketNameInterface
public byte[] receiveTransaction() throws IOException
receiveTransaction
in interface ClientCommunicationInterface
IOException
public byte[] receiveTransaction(Object[] isCompressed) throws IOException
receiveTransaction
in interface ClientCommunicationInterface
isCompressed
- First array member contains a true or false upon
return depending on transaction.IOException
public void sendTransaction(byte[] data) throws IOException
sendTransaction
in interface ClientCommunicationInterface
IOException
public void sendTransaction(byte[] data, int type) throws IOException
sendTransaction
in interface ClientCommunicationInterface
IOException
public boolean close()
close
in interface ClientCommunicationInterface
public void hardClose()
hardClose
in interface ClientCommunicationInterface
public ISocket getSocket()
getSocket
in interface ClientCommunicationInterface
public ServerSocketInterface2 getServerSocket()
getServerSocket
in interface ClientCommunicationInterface
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.