ACE_SSL
6.1.8
|
Defines methods in the ACE_SSL_SOCK_Stream abstraction. More...
#include <SSL_SOCK_Stream.h>
Public Types | |
typedef ACE_INET_Addr | PEER_ADDR |
Meta-type info. More... | |
Public Member Functions | |
ACE_SSL_SOCK_Stream (ACE_SSL_Context *context=ACE_SSL_Context::instance()) | |
Constructor. More... | |
~ACE_SSL_SOCK_Stream (void) | |
Destructor. More... | |
ssize_t | send (const void *buf, size_t n, int flags) const |
ssize_t | recv (void *buf, size_t n, int flags) const |
ssize_t | send (const void *buf, size_t n) const |
ssize_t | recv (void *buf, size_t n) const |
ssize_t | sendv (const iovec iov[], size_t n, const ACE_Time_Value *timeout=0) const |
Send an iovec of size n to the ssl socket. More... | |
ssize_t | recvv (iovec *io_vec, const ACE_Time_Value *timeout=0) const |
ssize_t | send (const void *buf, size_t n, int flags, const ACE_Time_Value *timeout) const |
ssize_t | recv (void *buf, size_t n, int flags, const ACE_Time_Value *timeout) const |
ssize_t | send (const void *buf, size_t n, const ACE_Time_Value *timeout) const |
ssize_t | recv (void *buf, size_t n, const ACE_Time_Value *timeout) const |
ssize_t | send (size_t n,...) const |
Send n varargs messages to the connected ssl socket. More... | |
ssize_t | recv (size_t n,...) const |
Recv n varargs messages to the connected ssl socket. More... | |
ssize_t | send_n (const void *buf, int n) const |
Send n bytes, keep trying until n are sent. More... | |
ssize_t | recv_n (void *buf, int n) const |
Recv n bytes, keep trying until n are received. More... | |
ssize_t | sendv_n (const iovec iov[], size_t n) const |
ssize_t | recvv_n (iovec iov[], size_t n) const |
Receive an iovec of size n to the connected socket. More... | |
int | close (void) |
Close down the socket. More... | |
void | set_handle (ACE_HANDLE fd) |
Overridden set_handle() method. More... | |
SSL * | ssl (void) const |
Return a pointer to the underlying SSL structure. More... | |
int | get_remote_addr (ACE_Addr &) const |
ACE_SOCK_Stream & | peer (void) |
Return the underlying ACE_SOCK_Stream which ACE_SSL runs atop of. More... | |
ssize_t | send_n (const void *buf, int n, int flags) const |
Send n bytes, keep trying until n are sent. More... | |
ssize_t | recv_n (void *buf, int n, int flags) const |
Recv n bytes, keep trying until n are sent. More... | |
ssize_t | send_n (const void *buf, size_t len, int flags, const ACE_Time_Value *timeout, size_t *bytes_transferred=0) const |
ssize_t | send_n (const void *buf, size_t len, const ACE_Time_Value *timeout, size_t *bytes_transferred=0) const |
ssize_t | recv_n (void *buf, size_t len, int flags, const ACE_Time_Value *timeout, size_t *bytes_transferred=0) const |
ssize_t | recv_n (void *buf, size_t len, const ACE_Time_Value *timeout, size_t *bytes_transferred=0) const |
int | close_reader (void) |
Close down the reader. More... | |
int | close_writer (void) |
Close down the writer. More... | |
![]() | |
int | set_option (int level, int option, void *optval, int optlen) const |
int | get_option (int level, int option, void *optval, int *optlen) const |
int | enable (int value) const |
int | disable (int value) const |
void | set_handle (ACE_HANDLE) |
ACE_HANDLE | get_handle (void) const |
int | control (int cmd, void *arg) const |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. More... | |
Protected Member Functions | |
ssize_t | send_i (const void *buf, size_t n, int flags) const |
ssize_t | recv_i (void *buf, size_t n, int flags, const ACE_Time_Value *timeout) const |
![]() | |
ACE_SSL_SOCK (void) | |
~ACE_SSL_SOCK (void) | |
Destructor. More... | |
Protected Attributes | |
SSL * | ssl_ |
The SSL session. More... | |
ACE_SOCK_Stream | stream_ |
The stream which works under the ssl connection. More... | |
Defines methods in the ACE_SSL_SOCK_Stream abstraction.
This class encapsulates the methods and functionality necessary to send and receive data over TLS/SSL.
Meta-type info.
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_SSL_SOCK_Stream::ACE_SSL_SOCK_Stream | ( | ACE_SSL_Context * | context = ACE_SSL_Context::instance () | ) |
Constructor.
context | Pointer to ACE_SSL_Context instance containing the OpenSSL SSL data structure to be associated with this ACE_SSL_SOCK_Stream . The SSL data structure will be copied to make it at least logically independent of the supplied context. |
ACE_SSL_SOCK_Stream::~ACE_SSL_SOCK_Stream | ( | void | ) |
Destructor.
ACE_INLINE int ACE_SSL_SOCK_Stream::close | ( | void | ) |
Close down the socket.
ACE_INLINE int ACE_SSL_SOCK_Stream::close_reader | ( | void | ) |
Close down the reader.
Selectively close endpoints.
ACE_INLINE int ACE_SSL_SOCK_Stream::close_writer | ( | void | ) |
Close down the writer.
int ACE_SSL_SOCK_Stream::get_remote_addr | ( | ACE_Addr & | addr | ) | const |
Return the address of the remotely connected peer (if there is one), in the referenced <ACE_Addr>. Returns 0 if successful, else -1.
ACE_INLINE ACE_SOCK_Stream & ACE_SSL_SOCK_Stream::peer | ( | void | ) |
Return the underlying ACE_SOCK_Stream which ACE_SSL runs atop of.
ACE_INLINE ssize_t ACE_SSL_SOCK_Stream::recv | ( | void * | buf, |
size_t | n, | ||
int | flags | ||
) | const |
Recv an n byte buffer from the ssl socket using the semantics of recv(3n). ACE_SSL supports MSG_PEEK, but no other flags at this time.
ACE_INLINE ssize_t ACE_SSL_SOCK_Stream::recv | ( | void * | buf, |
size_t | n | ||
) | const |
Recv an n byte buffer from the ssl socket using the semantics of read(2).
ssize_t ACE_SSL_SOCK_Stream::recv | ( | void * | buf, |
size_t | n, | ||
int | flags, | ||
const ACE_Time_Value * | timeout | ||
) | const |
ACE_INLINE ssize_t ACE_SSL_SOCK_Stream::recv | ( | void * | buf, |
size_t | n, | ||
const ACE_Time_Value * | timeout | ||
) | const |
ssize_t ACE_SSL_SOCK_Stream::recv | ( | size_t | n, |
... | |||
) | const |
Recv n varargs messages to the connected ssl socket.
|
protected |
ACE_INLINE ssize_t ACE_SSL_SOCK_Stream::recv_n | ( | void * | buf, |
int | n | ||
) | const |
Recv n bytes, keep trying until n are received.
ssize_t ACE_SSL_SOCK_Stream::recv_n | ( | void * | buf, |
int | n, | ||
int | flags | ||
) | const |
Recv n bytes, keep trying until n are sent.
ssize_t ACE_SSL_SOCK_Stream::recv_n | ( | void * | buf, |
size_t | len, | ||
int | flags, | ||
const ACE_Time_Value * | timeout, | ||
size_t * | bytes_transferred = 0 |
||
) | const |
Try to receive exactly len bytes into buf (uses the recv() call). The ACE_Time_Value indicates how long to blocking trying to receive. If timeout == 0, the caller will block until action is possible, else will wait until the relative time specified in timeout elapses). If recv() blocks for longer than timeout the number of bytes actually read is returned with errno == ETIME. If a timeout does not occur, recv_n return len (i.e., the number of bytes requested to be read).
ACE_INLINE ssize_t ACE_SSL_SOCK_Stream::recv_n | ( | void * | buf, |
size_t | len, | ||
const ACE_Time_Value * | timeout, | ||
size_t * | bytes_transferred = 0 |
||
) | const |
Try to receive exactly len bytes into buf (uses the recv() call). The ACE_Time_Value indicates how long to blocking trying to receive. If timeout == 0, the caller will block until action is possible, else will wait until the relative time specified in timeout elapses). If recv() blocks for longer than timeout the number of bytes actually read is returned with errno == ETIME. If a timeout does not occur, recv_n return len (i.e., the number of bytes requested to be read).
ssize_t ACE_SSL_SOCK_Stream::recvv | ( | iovec * | io_vec, |
const ACE_Time_Value * | timeout = 0 |
||
) | const |
Allows a client to read from a socket without having to provide a buffer to read. This method determines how much data is in the socket, allocates a buffer of this size, reads in the data, and returns the number of bytes read. The caller is responsible for deleting the member in the iov_base field of io_vec using delete [] io_vec->iov_base.
ssize_t ACE_SSL_SOCK_Stream::recvv_n | ( | iovec | iov[], |
size_t | n | ||
) | const |
Receive an iovec of size n to the connected socket.
ACE_INLINE ssize_t ACE_SSL_SOCK_Stream::send | ( | const void * | buf, |
size_t | n, | ||
int | flags | ||
) | const |
Send an n byte buffer to the ssl socket using the semantics of send(3n). ACE_SSL supports no flags for sending at this time.
ACE_INLINE ssize_t ACE_SSL_SOCK_Stream::send | ( | const void * | buf, |
size_t | n | ||
) | const |
Send an n byte buffer to the ssl socket using the semantics of write(2).
ssize_t ACE_SSL_SOCK_Stream::send | ( | const void * | buf, |
size_t | n, | ||
int | flags, | ||
const ACE_Time_Value * | timeout | ||
) | const |
ACE_INLINE ssize_t ACE_SSL_SOCK_Stream::send | ( | const void * | buf, |
size_t | n, | ||
const ACE_Time_Value * | timeout | ||
) | const |
ssize_t ACE_SSL_SOCK_Stream::send | ( | size_t | n, |
... | |||
) | const |
Send n varargs messages to the connected ssl socket.
|
protected |
ACE_INLINE ssize_t ACE_SSL_SOCK_Stream::send_n | ( | const void * | buf, |
int | n | ||
) | const |
Send n bytes, keep trying until n are sent.
ssize_t ACE_SSL_SOCK_Stream::send_n | ( | const void * | buf, |
int | n, | ||
int | flags | ||
) | const |
ssize_t ACE_SSL_SOCK_Stream::send_n | ( | const void * | buf, |
size_t | len, | ||
int | flags, | ||
const ACE_Time_Value * | timeout, | ||
size_t * | bytes_transferred = 0 |
||
) | const |
ACE_INLINE ssize_t ACE_SSL_SOCK_Stream::send_n | ( | const void * | buf, |
size_t | len, | ||
const ACE_Time_Value * | timeout, | ||
size_t * | bytes_transferred = 0 |
||
) | const |
ssize_t ACE_SSL_SOCK_Stream::sendv | ( | const iovec | iov[], |
size_t | n, | ||
const ACE_Time_Value * | timeout = 0 |
||
) | const |
Send an iovec of size n to the ssl socket.
Note that it is not possible to perform a "scattered" write with the underlying OpenSSL implementation. As such, the expected semantics are not fully reproduced with this implementation.
ssize_t ACE_SSL_SOCK_Stream::sendv_n | ( | const iovec | iov[], |
size_t | n | ||
) | const |
Send an iovec of size n to the connected socket. Will block until all bytes are sent or an error occurs.
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE void ACE_SSL_SOCK_Stream::set_handle | ( | ACE_HANDLE | fd | ) |
Overridden set_handle() method.
Only an ACE_SSL_SOCK_Acceptor or ACE_SSL_SOCK_Connector should access this method since some state in the underlying "ssl_" data structure is set during SSL connection establishment.
ACE_INLINE SSL * ACE_SSL_SOCK_Stream::ssl | ( | void | ) | const |
Return a pointer to the underlying SSL structure.
ACE_SSL_SOCK_Stream::ACE_ALLOC_HOOK_DECLARE |
Declare the dynamic allocation hooks.
|
protected |
The SSL session.
|
protected |
The stream which works under the ssl connection.