AESSocket Manager
The AESSocketManager
class is useful to dynamically manage communication by sockets with AES encryption
Author
N7ghtm4r3 - Tecknobit
Since
2.1.5
See also
Constructors
Link copied to clipboard
constructor(host: String, serverPort: Int, ivSpec: String, secretKey: String, algorithm: BaseCipher.Algorithm)
Constructor to init AESSocketManager
constructor(host: String, serverPort: Int, ivSpec: IvParameterSpec, secretKey: SecretKey, algorithm: BaseCipher.Algorithm)
Constructor to init AESSocketManager
Constructor to init AESSocketManager
constructor(allowMultipleListeners: Boolean, ivSpec: String, secretKey: String, algorithm: BaseCipher.Algorithm)
Constructor to init AESSocketManager
constructor(allowMultipleListeners: Boolean, ivSpec: IvParameterSpec, secretKey: SecretKey, algorithm: BaseCipher.Algorithm)
Constructor to init AESSocketManager
Constructor to init AESSocketManager
Properties
Link copied to clipboard
allowMultipleListeners
whether accept multiple listeners at the same timeLink copied to clipboard
continueSingleRoutine
whether continue the routine for the single listener if allowMultipleListeners is set to "false"
Link copied to clipboard
currentHost
current server host used in the communicationLink copied to clipboard
currentServerPort
current server port used in the communicationLink copied to clipboard
defaultErrorResponse
default error responseLink copied to clipboard
defaultSuccessResponse
default successful responseLink copied to clipboard
"executor"
of the routinesLink copied to clipboard
Link copied to clipboard
Link copied to clipboard
NEW_LINE_REPLACER
is the constants which indicates the replacer to use when the content message contains multiple linesLink copied to clipboard
publicHostAddress
public host addressLink copied to clipboard
serverSocket
socket managed by the serverFunctions
Link copied to clipboard
Method to accept a new socket request No-any params required
Link copied to clipboard
Method to accept a new socket request
Link copied to clipboard
Method to get allowMultipleListeners instance No-any params required
Link copied to clipboard
open fun changeCipherKeys(ivSpec: IvParameterSpec, secretKey: SecretKey, algorithm: BaseCipher.Algorithm)
Method to change the cipher keys during the runtime
Link copied to clipboard
Method to stop the communication No-any params required
Link copied to clipboard
Method to get if the listener's workflow needs to continue or not Any param required
Link copied to clipboard
Method to get if the listener's workflow needs to continue or not
Link copied to clipboard
Method to get serverSocket instance No-any params required
Link copied to clipboard
Method to get socket instance No-any params required
Link copied to clipboard
This method is used to get the initialization vector No-any params required
Link copied to clipboard
This method is used to get the secret key No-any params required
Link copied to clipboard
Method to get currentServerPort instance No-any params required
Link copied to clipboard
Method to get executor instance No-any params required
Link copied to clipboard
This method is used to get an ip address from a Socket
Link copied to clipboard
This method is used to get the initialization vector No-any params required
Link copied to clipboard
Method to get listeners instance No-any params required
Link copied to clipboard
This method is used to get the secret key No-any params required
Link copied to clipboard
Method to get serverUse instance No-any params required
Link copied to clipboard
Method to read a content message received with the socket request No-any params required
Method to read an encrypted content message received with the socket request
Link copied to clipboard
Method to read the last encrypted content message red in the stream with the socket request No-any params required
Link copied to clipboard
Method to send the defaultErrorResponse No-any params required
Link copied to clipboard
Method to send the defaultErrorResponse
Link copied to clipboard
Method to send the defaultSuccessResponse No-any params required
Link copied to clipboard
Method to send the defaultSuccessResponse
Link copied to clipboard
Method to set the cipher instance
Link copied to clipboard
Method to set the default error response to send as error
Link copied to clipboard
Method to set the default successful response to send as success
Link copied to clipboard
Method to start a new listener
Link copied to clipboard
Method to stop the listener's workflow No-any params required
Link copied to clipboard
Method to stop the listener's workflow Any param required
SocketManager socketManager = new SocketManager(false);
socketManager.startListener(3218, new Runnable() {
public void run() {
while (socketManager.continueListening()) {
// do listener's workflow
}
// listener's workflow when has been stopped
}
});
// your code's workflow
socketManager.stopListener(); // --> the single listener will be stopped
Content copied to clipboard
Link copied to clipboard
Method to stop the listener's workflow
Link copied to clipboard
Method to write a content message to send with the socket request
Link copied to clipboard
Method to write a content message to send with the socket request
Method to write an encrypted content message to send with the socket request
Link copied to clipboard
Method to write a plain content message to send with the socket request
Link copied to clipboard
Method to write a plain content message to send with the socket request