summaryrefslogtreecommitdiff
path: root/ACE/ace/ACE.cpp
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2010-07-12 11:05:04 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2010-07-12 11:05:04 +0000
commit1e140f84b5bcac153e95c2e6cf83436f15ee8596 (patch)
tree861124f3162a9c3518e552e7074c28d0694e5e9a /ACE/ace/ACE.cpp
parent286eedd2fc603c3c384ae9dd0d70133bd0694474 (diff)
downloadATCD-1e140f84b5bcac153e95c2e6cf83436f15ee8596.tar.gz
Mon Jul 12 11:04:58 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
* ace/ACE.cpp: * ace/Activation_Queue.h: * ace/Active_Map_Manager.h: * ace/Dev_Poll_Reactor.h: * ace/Dev_Poll_Reactor.inl: * ace/Event_Handler.h: * ace/Filecache.h: * ace/Manual_Event.h: * ace/Map_Manager.h: * ace/Mem_Map.h: * ace/Message_Block.h: * ace/OS_Log_Msg_Attributes.h: * ace/OS_NS_unistd.h: * ace/Object_Manager.h: * ace/Recursive_Thread_Mutex.h: Layout, const, and doxygen fixes
Diffstat (limited to 'ACE/ace/ACE.cpp')
-rw-r--r--ACE/ace/ACE.cpp98
1 files changed, 36 insertions, 62 deletions
diff --git a/ACE/ace/ACE.cpp b/ACE/ace/ACE.cpp
index 03c35fc991d..f46e8219d0f 100644
--- a/ACE/ace/ACE.cpp
+++ b/ACE/ace/ACE.cpp
@@ -658,8 +658,7 @@ ACE::recv_n_i (ACE_HANDLE handle,
errno == EWOULDBLOCK)
{
// Wait upto <timeout> for the blocking to subside.
- int rtn = ACE::handle_read_ready (handle,
- timeout);
+ int const rtn = ACE::handle_read_ready (handle, timeout);
// Did select() succeed?
if (rtn != -1)
@@ -720,8 +719,7 @@ ACE::t_rcv_n_i (ACE_HANDLE handle,
if (errno == EWOULDBLOCK)
{
// Wait for the blocking to subside.
- int result = ACE::handle_read_ready (handle,
- 0);
+ int const result = ACE::handle_read_ready (handle, 0);
// Did select() succeed?
if (result != -1)
@@ -778,8 +776,7 @@ ACE::t_rcv_n_i (ACE_HANDLE handle,
errno == EWOULDBLOCK)
{
// Wait upto <timeout> for the blocking to subside.
- int rtn = ACE::handle_read_ready (handle,
- timeout);
+ int const rtn = ACE::handle_read_ready (handle, timeout);
// Did select() succeed?
if (rtn != -1)
@@ -839,8 +836,7 @@ ACE::recv_n_i (ACE_HANDLE handle,
if (errno == EWOULDBLOCK)
{
// Wait for the blocking to subside.
- int result = ACE::handle_read_ready (handle,
- 0);
+ int const result = ACE::handle_read_ready (handle, 0);
// Did select() succeed?
if (result != -1)
@@ -895,8 +891,7 @@ ACE::recv_n_i (ACE_HANDLE handle,
errno == EWOULDBLOCK)
{
// Wait upto <timeout> for the blocking to subside.
- int rtn = ACE::handle_read_ready (handle,
- timeout);
+ int const rtn = ACE::handle_read_ready (handle, timeout);
// Did select() succeed?
if (rtn != -1)
@@ -934,8 +929,8 @@ ssize_t
ACE::recv (ACE_HANDLE handle, size_t n, ...)
{
va_list argp;
- int total_tuples = static_cast<int> (n / 2);
- iovec *iovp;
+ int const total_tuples = static_cast<int> (n / 2);
+ iovec *iovp = 0;
#if defined (ACE_HAS_ALLOCA)
iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
#else
@@ -952,7 +947,7 @@ ACE::recv (ACE_HANDLE handle, size_t n, ...)
iovp[i].iov_len = va_arg (argp, int);
}
- ssize_t result = ACE_OS::recvv (handle, iovp, total_tuples);
+ ssize_t const result = ACE_OS::recvv (handle, iovp, total_tuples);
#if !defined (ACE_HAS_ALLOCA)
delete [] iovp;
#endif /* !defined (ACE_HAS_ALLOCA) */
@@ -992,14 +987,10 @@ ACE::recvv_n_i (ACE_HANDLE handle,
size_t &bytes_transferred = bt == 0 ? temp : *bt;
bytes_transferred = 0;
- for (int s = 0;
- s < iovcnt;
- )
+ for (int s = 0; s < iovcnt; )
{
// Try to transfer as much of the remaining data as possible.
- ssize_t n = ACE_OS::recvv (handle,
- iov + s,
- iovcnt - s);
+ ssize_t n = ACE_OS::recvv (handle, iov + s, iovcnt - s);
// Check EOF.
if (n == 0)
return 0;
@@ -1011,8 +1002,7 @@ ACE::recvv_n_i (ACE_HANDLE handle,
if (errno == EWOULDBLOCK)
{
// Wait for the blocking to subside.
- int result = ACE::handle_read_ready (handle,
- 0);
+ int const result = ACE::handle_read_ready (handle, 0);
// Did select() succeed?
if (result != -1)
@@ -1060,28 +1050,21 @@ ACE::recvv_n_i (ACE_HANDLE handle,
int val = 0;
ACE::record_and_set_non_blocking_mode (handle, val);
- for (int s = 0;
- s < iovcnt;
- )
+ for (int s = 0; s < iovcnt; )
{
// Try to transfer as much of the remaining data as possible.
// Since the socket is in non-blocking mode, this call will not
// block.
- ssize_t n = ACE_OS::recvv (handle,
- iov + s,
- iovcnt - s);
+ ssize_t n = ACE_OS::recvv (handle, iov + s, iovcnt - s);
// Check for errors.
- if (n == 0 ||
- n == -1)
+ if (n == 0 || n == -1)
{
// Check for possible blocking.
- if (n == -1 &&
- errno == EWOULDBLOCK)
+ if (n == -1 && errno == EWOULDBLOCK)
{
// Wait upto <timeout> for the blocking to subside.
- int rtn = ACE::handle_read_ready (handle,
- timeout);
+ int const rtn = ACE::handle_read_ready (handle, timeout);
// Did select() succeed?
if (rtn != -1)
@@ -1242,7 +1225,8 @@ ACE::send (ACE_HANDLE handle,
return -1;
else
{
- ssize_t bytes_transferred = ACE_OS::send (handle, (const char *) buf, n, flags);
+ ssize_t const bytes_transferred =
+ ACE_OS::send (handle, (const char *) buf, n, flags);
ACE::restore_non_blocking_mode (handle, val);
return bytes_transferred;
}
@@ -1267,7 +1251,8 @@ ACE::t_snd (ACE_HANDLE handle,
return -1;
else
{
- ssize_t bytes_transferred = ACE_OS::t_snd (handle, (const char *) buf, n, flags);
+ ssize_t const bytes_transferred =
+ ACE_OS::t_snd (handle, (const char *) buf, n, flags);
ACE::restore_non_blocking_mode (handle, val);
return bytes_transferred;
}
@@ -1291,7 +1276,7 @@ ACE::send (ACE_HANDLE handle,
return -1;
else
{
- ssize_t bytes_transferred = ACE::send_i (handle, buf, n);
+ ssize_t const bytes_transferred = ACE::send_i (handle, buf, n);
ACE::restore_non_blocking_mode (handle, val);
return bytes_transferred;
}
@@ -1313,7 +1298,8 @@ ACE::sendmsg (ACE_HANDLE handle,
return -1;
else
{
- ssize_t bytes_transferred = ACE_OS::sendmsg (handle, msg, flags);
+ ssize_t const bytes_transferred =
+ ACE_OS::sendmsg (handle, msg, flags);
ACE::restore_non_blocking_mode (handle, val);
return bytes_transferred;
}
@@ -1338,7 +1324,7 @@ ACE::sendto (ACE_HANDLE handle,
return -1;
else
{
- ssize_t bytes_transferred =
+ ssize_t const bytes_transferred =
ACE_OS::sendto (handle, buf, len, flags, addr, addrlen);
ACE::restore_non_blocking_mode (handle, val);
return bytes_transferred;
@@ -1381,8 +1367,7 @@ ACE::send_n_i (ACE_HANDLE handle,
#endif /* ACE_WIN32 */
{
// Wait for the blocking to subside.
- int result = ACE::handle_write_ready (handle,
- 0);
+ int const result = ACE::handle_write_ready (handle, 0);
// Did select() succeed?
if (result != -1)
@@ -1435,12 +1420,10 @@ ACE::send_n_i (ACE_HANDLE handle,
n == -1)
{
// Check for possible blocking.
- if (n == -1 &&
- (errno == EWOULDBLOCK || errno == ENOBUFS))
+ if (n == -1 && (errno == EWOULDBLOCK || errno == ENOBUFS))
{
// Wait upto <timeout> for the blocking to subside.
- int rtn = ACE::handle_write_ready (handle,
- timeout);
+ int const rtn = ACE::handle_write_ready (handle, timeout);
// Did select() succeed?
if (rtn != -1)
@@ -1505,8 +1488,7 @@ ACE::t_snd_n_i (ACE_HANDLE handle,
if (errno == EWOULDBLOCK || errno == ENOBUFS)
{
// Wait for the blocking to subside.
- int result = ACE::handle_write_ready (handle,
- 0);
+ int const result = ACE::handle_write_ready (handle, 0);
// Did select() succeed?
if (result != -1)
@@ -1563,8 +1545,7 @@ ACE::t_snd_n_i (ACE_HANDLE handle,
errno == EWOULDBLOCK || errno == ENOBUFS)
{
// Wait upto <timeout> for the blocking to subside.
- int rtn = ACE::handle_write_ready (handle,
- timeout);
+ int const rtn = ACE::handle_write_ready (handle, timeout);
// Did select() succeed?
if (rtn != -1)
@@ -1625,8 +1606,7 @@ ACE::send_n_i (ACE_HANDLE handle,
if (errno == EWOULDBLOCK || errno == ENOBUFS)
{
// Wait for the blocking to subside.
- int result = ACE::handle_write_ready (handle,
- 0);
+ int const result = ACE::handle_write_ready (handle, 0);
// Did select() succeed?
if (result != -1)
@@ -1681,8 +1661,7 @@ ACE::send_n_i (ACE_HANDLE handle,
(errno == EWOULDBLOCK || errno == ENOBUFS))
{
// Wait upto <timeout> for the blocking to subside.
- int rtn = ACE::handle_write_ready (handle,
- timeout);
+ int const rtn = ACE::handle_write_ready (handle, timeout);
// Did select() succeed?
if (rtn != -1)
@@ -1788,9 +1767,8 @@ ACE::sendv_n_i (ACE_HANDLE handle,
)
{
// Try to transfer as much of the remaining data as possible.
- ssize_t n = ACE_OS::sendv (handle,
- iov + s,
- iovcnt - s);
+ ssize_t n = ACE_OS::sendv (handle, iov + s, iovcnt - s);
+
// Check EOF.
if (n == 0)
return 0;
@@ -1802,8 +1780,7 @@ ACE::sendv_n_i (ACE_HANDLE handle,
if (errno == EWOULDBLOCK || errno == ENOBUFS)
{
// Wait for the blocking to subside.
- int result = ACE::handle_write_ready (handle,
- 0);
+ int const result = ACE::handle_write_ready (handle, 0);
// Did select() succeed?
if (result != -1)
@@ -1860,9 +1837,7 @@ ACE::sendv_n_i (ACE_HANDLE handle,
// Try to transfer as much of the remaining data as possible.
// Since the socket is in non-blocking mode, this call will not
// block.
- ssize_t n = ACE_OS::sendv (handle,
- iov + s,
- iovcnt - s);
+ ssize_t n = ACE_OS::sendv (handle, iov + s, iovcnt - s);
// Check for errors.
if (n == 0 ||
@@ -1873,8 +1848,7 @@ ACE::sendv_n_i (ACE_HANDLE handle,
(errno == EWOULDBLOCK || errno == ENOBUFS))
{
// Wait upto <timeout> for the blocking to subside.
- int rtn = ACE::handle_write_ready (handle,
- timeout);
+ int const rtn = ACE::handle_write_ready (handle, timeout);
// Did select() succeed?
if (rtn != -1)