From 4073746bdd7b303aa9618250263680142965c2e7 Mon Sep 17 00:00:00 2001 From: Volker Christian Date: Thu, 28 Mar 2024 08:35:35 +0100 Subject: [PATCH] Work on README.md Signed-off-by: Volker Christian --- README.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f85d597e4..4332d9eca 100644 --- a/README.md +++ b/README.md @@ -1020,16 +1020,57 @@ which returns a pointer to the `SSL` structure of *OpenSSL* used for encryption, #### Most Important common `SocketConnection` Methods -| Method | Explanation | -| ------------------------------------------------------------ | ------------------------------------------------------------ | -| `int getFd()` | Returns the underlying descriptor used for communication. | -| `SSL* getSSL()` | Returns the pointer to the OpenSSL SSL structure. | -| `void sendToPeer(const char* junk, std::size_t junkLen)`
`void sendToPeer(const std::string& data)`
`void sendToPeer(const std::vector& data)`
`void sendToPeer(const std::vector& data)` | Enqueue data to be sent to peer. | -| `std::size_t readFromPeer(char* junk, std::size_t junkLen)` | Read already received data from peer. | -| `void shutdownRead()`
`void shutdownWrite(bool forceClose = false)` | Shut down socket either for reading or writing. If `forceClose` is `true` the reading end will also be shut down. | -| `void close()` | Hard close the connection without a prior shutdown. | -| `void setTimeout(utils::Timeval& timeout)` | Set the inactivity timeout of a connection (default 60 seconds).
If no data has been transfered within this amount of time
the connection is terminated. | -| `bool isValid()` | Check if a connection has been created successfully. | +- Get the unserlying descriptor used for communication. + + ```c++ + int getFd() + ``` + +- Get the pointer to OpenSSL's `SSL` structure. + + ```c++ + SSL* getSSL() + ``` + +- Enqueue data to be send to the peer. + + ```c++ + void sendToPeer(const char* junk, std::size_t junkLen) + void sendToPeer(const std::string& data) + void sendToPeer(const std::vector& data) + void sendToPeer(const std::vector& data) + ``` + +- Read already received data from peer. + + ```c++ + std::size_t readFromPeer(char* junk, std::size_t junkLen) + ``` + +- Shut down socket either for reading or writing. If `forceClose` is `true` the reading end will also be shut down. + + ```c++ + void shutdownRead() + void shutdownWrite(bool forceClose = false) + ``` + +- Hard close the connection without a prior shutdown. + + ```c++ + void close() + ``` + +- Set the inactivity timeout of a connection (default 60 seconds). If no data has been transfered within this amount of time the connection is terminated. + + ```c++ + void setTimeout(utils::Timeval& timeout) + ``` + +- Check if a connection has been created successfully. + + ```c++ + bool isValid() + ``` ### Constructors of `SocketServer` and `SocketClient` Classes