From bd3b36337c219d5ed3835a1d744ad5cdfb3add24 Mon Sep 17 00:00:00 2001 From: mcorino Date: Thu, 15 Jul 2010 12:36:57 +0000 Subject: Thu Jul 15 12:35:30 UTC 2010 Martin Corino * ace/SSL/SSL_SOCK_Stream.h: * ace/SSL/SSL_SOCK_Stream.inl: Added two method overloads available in ACE_SOCK_Stream but missing from ACE_SSL_SOCK_Stream. --- ACE/ChangeLog | 7 +++++++ ACE/ace/SSL/SSL_SOCK_Stream.h | 27 +++++++++++++++++++++++++++ ACE/ace/SSL/SSL_SOCK_Stream.inl | 20 ++++++++++++++++++++ 3 files changed, 54 insertions(+) (limited to 'ACE') diff --git a/ACE/ChangeLog b/ACE/ChangeLog index 622b1c79a22..c0a3ec00ef0 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,10 @@ +Thu Jul 15 12:35:30 UTC 2010 Martin Corino + + * ace/SSL/SSL_SOCK_Stream.h: + * ace/SSL/SSL_SOCK_Stream.inl: + Added two method overloads available in ACE_SOCK_Stream but + missing from ACE_SSL_SOCK_Stream. + Thu Jul 15 09:49:28 UTC 2010 Johnny Willemsen * ace/config-doxygen.h: diff --git a/ACE/ace/SSL/SSL_SOCK_Stream.h b/ACE/ace/SSL/SSL_SOCK_Stream.h index 0690dce9839..f7a7da788bd 100644 --- a/ACE/ace/SSL/SSL_SOCK_Stream.h +++ b/ACE/ace/SSL/SSL_SOCK_Stream.h @@ -206,6 +206,18 @@ public: const ACE_Time_Value *timeout, size_t *bytes_transferred = 0) const; + /** + * Try to send exactly len bytes into buf (uses the send() call). + * If send() blocks for longer than timeout the number of bytes + * actually sent is returned with errno == ETIME. If a timeout does + * not occur, send_n() return len (i.e., the number of bytes + * requested to be sent). + */ + ssize_t send_n (const 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 @@ -221,6 +233,21 @@ public: 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). + */ + ssize_t recv_n (void *buf, + size_t len, + const ACE_Time_Value *timeout, + size_t *bytes_transferred = 0) const; //@} /** diff --git a/ACE/ace/SSL/SSL_SOCK_Stream.inl b/ACE/ace/SSL/SSL_SOCK_Stream.inl index 756fd3a858c..ca4e48ee22f 100644 --- a/ACE/ace/SSL/SSL_SOCK_Stream.inl +++ b/ACE/ace/SSL/SSL_SOCK_Stream.inl @@ -251,6 +251,16 @@ ACE_SSL_SOCK_Stream::recv_n (void *buf, int buf_size) const return this->recv_n (buf, buf_size, 0); } +ACE_INLINE ssize_t +ACE_SSL_SOCK_Stream::recv_n (void *buf, + size_t len, + const ACE_Time_Value *timeout, + size_t *bytes_transferred) const +{ + ACE_TRACE ("ACE_SSL_SOCK_Stream::recv_n"); + return this->recv_n (buf, len, 0, timeout, bytes_transferred); +} + ACE_INLINE ssize_t ACE_SSL_SOCK_Stream::send_n (const void *buf, int len) const { @@ -258,6 +268,16 @@ ACE_SSL_SOCK_Stream::send_n (const void *buf, int len) const return this->send_n (buf, len, 0); } +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) const +{ + ACE_TRACE ("ACE_SSL_SOCK_Stream::send_n"); + return this->send_n (buf, len, 0, timeout, bytes_transferred); +} + ACE_INLINE int ACE_SSL_SOCK_Stream::close_reader (void) { -- cgit v1.2.1