ACE  6.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Macros | Functions
ACE.h File Reference
#include "ace/Basic_Types.h"
#include "ace/Default_Constants.h"
#include "ace/ACE.inl"

Namespaces

 ACE
 The namespace containing the ACE framework itself.
 

Macros

#define ACE_EXPORT_MACRO   ACE_Export
 

Functions

u_int ACE::major_version (void)
 e.g., the "5" in ACE 5.1.12. More...
 
u_int ACE::minor_version (void)
 e.g., the "1" in ACE 5.1.12. More...
 
u_int ACE::beta_version (void)
 
const ACE_TCHARACE::compiler_name (void)
 E.g., the "SunPro C++" in SunPro C++ 4.32.0. More...
 
u_int ACE::compiler_major_version (void)
 E.g., the "4" in SunPro C++ 4.32.0. More...
 
u_int ACE::compiler_minor_version (void)
 E.g., the "32" in SunPro C++ 4.32.0. More...
 
u_int ACE::compiler_beta_version (void)
 E.g., the "0" in SunPro C++ 4.32.0. More...
 
int ACE::out_of_handles (int error)
 
bool ACE::wild_match (const char *s, const char *pattern, bool case_sensitive=true, bool character_classes=false)
 
int ACE::handle_timed_accept (ACE_HANDLE listener, ACE_Time_Value *timeout, bool restart)
 
ACE_HANDLE ACE::handle_timed_complete (ACE_HANDLE listener, const ACE_Time_Value *timeout, int is_tli=0)
 
int ACE::set_handle_limit (int new_limit=-1, int increase_limit_only=0)
 
int ACE::max_handles (void)
 
ACE_TCHARACE::strenvdup (const ACE_TCHAR *str)
 
const char * ACE::strend (const char *s)
 
char * ACE::strnew (const char *s)
 
void ACE::strdelete (char *s)
 Delete the memory allocated by strnew. More...
 
char * ACE::strndup (const char *str, size_t n)
 
char * ACE::strnnew (const char *str, size_t n)
 
bool ACE::isdotdir (const char *s)
 Determine if a specified pathname is "dot dir" (ie. "." or ".."). More...
 
const wchar_t * ACE::strend (const wchar_t *s)
 
wchar_t * ACE::strnew (const wchar_t *s)
 
void ACE::strdelete (wchar_t *s)
 
wchar_t * ACE::strndup (const wchar_t *str, size_t n)
 
wchar_t * ACE::strnnew (const wchar_t *str, size_t n)
 
bool ACE::isdotdir (const wchar_t *s)
 
const ACE_TCHARACE::execname (const ACE_TCHAR *pathname)
 
const ACE_TCHARACE::basename (const ACE_TCHAR *pathname, ACE_TCHAR delim=ACE_DIRECTORY_SEPARATOR_CHAR)
 
const ACE_TCHARACE::dirname (const ACE_TCHAR *pathname, ACE_TCHAR delim=ACE_DIRECTORY_SEPARATOR_CHAR)
 
ACE_TCHARACE::timestamp (const ACE_Time_Value &time_value, ACE_TCHAR date_and_time[], size_t time_len, bool return_pointer_to_first_digit=false)
 
ACE_TCHARACE::timestamp (ACE_TCHAR date_and_time[], size_t time_len, bool return_pointer_to_first_digit=false)
 
pid_t ACE::fork (const ACE_TCHAR *program_name=ACE_TEXT("<unknown>"), int avoid_zombies=0)
 
int ACE::daemonize (const ACE_TCHAR pathname[]=ACE_TEXT("/"), bool close_all_handles=ACE_DEFAULT_CLOSE_ALL_HANDLES, const ACE_TCHAR program_name[]=ACE_TEXT("<unknown>"))
 
size_t ACE::round_to_pagesize (size_t len)
 Rounds the request to a multiple of the page size. More...
 
size_t ACE::round_to_allocation_granularity (size_t len)
 Rounds the request to a multiple of the allocation granularity. More...
 
size_t ACE::format_hexdump (const char *buffer, size_t size, ACE_TCHAR *obuf, size_t obuf_sz)
 
u_long ACE::hash_pjw (const char *str)
 Computes the hash value of {str} using the "Hash PJW" routine. More...
 
u_long ACE::hash_pjw (const char *str, size_t len)
 Computes the hash value of {str} using the "Hash PJW" routine. More...
 
u_long ACE::hash_pjw (const wchar_t *str)
 Computes the hash value of {str} using the "Hash PJW" routine. More...
 
u_long ACE::hash_pjw (const wchar_t *str, size_t len)
 Computes the hash value of {str} using the "Hash PJW" routine. More...
 
ACE_UINT16 ACE::crc_ccitt (const char *str)
 Computes CRC-CCITT for the string. More...
 
ACE_UINT16 ACE::crc_ccitt (const void *buf, size_t len, ACE_UINT16 crc=0)
 Computes CRC-CCITT for the buffer. More...
 
ACE_UINT16 ACE::crc_ccitt (const iovec *iov, int len, ACE_UINT16 crc=0)
 Computes CRC-CCITT for the @ len iovec buffers. More...
 
ACE_UINT32 ACE::crc32 (const char *str)
 Computes the ISO 8802-3 standard 32 bits CRC for the string. More...
 
ACE_UINT32 ACE::crc32 (const void *buf, size_t len, ACE_UINT32 crc=0)
 Computes the ISO 8802-3 standard 32 bits CRC for the buffer. More...
 
ACE_UINT32 ACE::crc32 (const iovec *iov, int len, ACE_UINT32 crc=0)
 
u_long ACE::gcd (u_long x, u_long y)
 Euclid's greatest common divisor algorithm. More...
 
u_long ACE::minimum_frame_size (u_long period1, u_long period2)
 Calculates the minimum enclosing frame size for the given values. More...
 
u_long ACE::is_prime (const u_long n, const u_long min_factor, const u_long max_factor)
 
int ACE::map_errno (int error)
 
const ACE_TCHARACE::sock_error (int error)
 
bool ACE::is_sock_error (int error)
 
int ACE::process_active (pid_t pid)
 
int ACE::terminate_process (pid_t pid)
 
void ACE::unique_name (const void *object, ACE_TCHAR *name, size_t length)
 
u_long ACE::log2 (u_long num)
 Computes the base 2 logarithm of {num}. More...
 
template<typename T >
bool ACE::is_equal (const T &a, const T &b)
 
template<typename T >
bool ACE::is_inequal (const T &a, const T &b)
 
ACE_TCHAR ACE::nibble2hex (u_int n)
 Hex conversion utility. More...
 
u_char ACE::hex2byte (ACE_TCHAR c)
 Convert a hex character to its byte representation. More...
 
bool ACE::debug (void)
 
void ACE::debug (bool onoff)
 
int ACE::select (int width, ACE_Handle_Set *readfds, ACE_Handle_Set *writefds=0, ACE_Handle_Set *exceptfds=0, const ACE_Time_Value *timeout=0)
 Wrapper facade for select that uses ACE_Handle_Sets. More...
 
int ACE::select (int width, ACE_Handle_Set &readfds, const ACE_Time_Value *timeout=0)
 
int ACE::handle_read_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout)
 
int ACE::handle_write_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout)
 
int ACE::handle_exception_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout)
 
int ACE::handle_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout, int read_ready, int write_ready, int exception_ready)
 
int ACE::enter_recv_timedwait (ACE_HANDLE handle, const ACE_Time_Value *timeout, int &val)
 
int ACE::enter_send_timedwait (ACE_HANDLE handle, const ACE_Time_Value *timeout, int &val)
 
void ACE::record_and_set_non_blocking_mode (ACE_HANDLE handle, int &val)
 
void ACE::restore_non_blocking_mode (ACE_HANDLE handle, int val)
 
ssize_t ACE::recv_i (ACE_HANDLE handle, void *buf, size_t len)
 
ssize_t ACE::recv_n_i (ACE_HANDLE handle, void *buf, size_t len, int flags, size_t *bytes_transferred)
 
ssize_t ACE::recv_n_i (ACE_HANDLE handle, void *buf, size_t len, int flags, const ACE_Time_Value *timeout, size_t *bytes_transferred)
 
ssize_t ACE::t_rcv_n_i (ACE_HANDLE handle, void *buf, size_t len, int *flags, size_t *bytes_transferred)
 
ssize_t ACE::t_rcv_n_i (ACE_HANDLE handle, void *buf, size_t len, int *flags, const ACE_Time_Value *timeout, size_t *bytes_transferred)
 
ssize_t ACE::recv_n_i (ACE_HANDLE handle, void *buf, size_t len, size_t *bytes_transferred)
 
ssize_t ACE::recv_n_i (ACE_HANDLE handle, void *buf, size_t len, const ACE_Time_Value *timeout, size_t *bytes_transferred)
 
ssize_t ACE::recvv_n_i (ACE_HANDLE handle, iovec *iov, int iovcnt, size_t *bytes_transferred)
 
ssize_t ACE::recvv_n_i (ACE_HANDLE handle, iovec *iov, int iovcnt, const ACE_Time_Value *timeout, size_t *bytes_transferred)
 
ssize_t ACE::send_i (ACE_HANDLE handle, const void *buf, size_t len)
 
ssize_t ACE::send_n_i (ACE_HANDLE handle, const void *buf, size_t len, int flags, size_t *bytes_transferred)
 
ssize_t ACE::send_n_i (ACE_HANDLE handle, const void *buf, size_t len, int flags, const ACE_Time_Value *timeout, size_t *bytes_transferred)
 
ssize_t ACE::t_snd_n_i (ACE_HANDLE handle, const void *buf, size_t len, int flags, size_t *bytes_transferred)
 
ssize_t ACE::t_snd_n_i (ACE_HANDLE handle, const void *buf, size_t len, int flags, const ACE_Time_Value *timeout, size_t *bytes_transferred)
 
ssize_t ACE::send_n_i (ACE_HANDLE handle, const void *buf, size_t len, size_t *bytes_transferred)
 
ssize_t ACE::send_n_i (ACE_HANDLE handle, const void *buf, size_t len, const ACE_Time_Value *timeout, size_t *bytes_transferred)
 
ssize_t ACE::sendv_n_i (ACE_HANDLE handle, const iovec *iov, int iovcnt, size_t *bytes_transferred)
 
ssize_t ACE::sendv_n_i (ACE_HANDLE handle, const iovec *iov, int iovcnt, const ACE_Time_Value *timeout, size_t *bytes_transferred)
 
I/O operations

Notes on common parameters:

handle is the connected endpoint that will be used for I/O.

buf is the buffer to write from or receive into.

len is the number of bytes to transfer.

The timeout parameter in the following methods indicates how long to blocking trying to transfer data. If timeout == 0, then the call behaves as a normal send/recv call, i.e., for blocking sockets, the call will block until action is possible; for non-blocking sockets, EWOULDBLOCK will be returned if no action is immediately possible.

If timeout != 0, the call will wait until the relative time specified in *timeout elapses.

The "_n()" I/O methods keep looping until all the data has been transferred. These methods also work for sockets in non-blocking mode i.e., they keep looping on EWOULDBLOCK. timeout is used to make sure we keep making progress, i.e., the same timeout value is used for every I/O operation in the loop and the timeout is not counted down.

The return values for the "*_n()" methods match the return values from the non "_n()" methods and are specified as follows:

  • On complete transfer, the number of bytes transferred is returned.
  • On timeout, -1 is returned, errno == ETIME.
  • On error, -1 is returned, errno is set to appropriate error.
  • On EOF, 0 is returned, errno is irrelevant.

On partial transfers, i.e., if any data is transferred before timeout / error / EOF, bytes_transferred> will contain the number of bytes transferred.

Methods with iovec parameter are I/O vector variants of the I/O operations.

Methods with the extra flags argument will always result in send getting called. Methods without the extra flags argument will result in send getting called on Win32 platforms, and write getting called on non-Win32 platforms.

ssize_t ACE::recv (ACE_HANDLE handle, void *buf, size_t len, int flags, const ACE_Time_Value *timeout=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::t_rcv (ACE_HANDLE handle, void *buf, size_t len, int *flags, const ACE_Time_Value *timeout=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::recv (ACE_HANDLE handle, void *buf, size_t len, const ACE_Time_Value *timeout=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::recvmsg (ACE_HANDLE handle, struct msghdr *msg, int flags, const ACE_Time_Value *timeout=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::recvfrom (ACE_HANDLE handle, char *buf, int len, int flags, struct sockaddr *addr, int *addrlen, const ACE_Time_Value *timeout=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::recv_n (ACE_HANDLE handle, void *buf, size_t len, int flags, const ACE_Time_Value *timeout=0, size_t *bytes_transferred=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::t_rcv_n (ACE_HANDLE handle, void *buf, size_t len, int *flags, const ACE_Time_Value *timeout=0, size_t *bytes_transferred=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::recv_n (ACE_HANDLE handle, void *buf, size_t len, const ACE_Time_Value *timeout=0, size_t *bytes_transferred=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::recv (ACE_HANDLE handle, size_t n,...)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::recvv (ACE_HANDLE handle, iovec *iov, int iovcnt, const ACE_Time_Value *timeout=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::recvv_n (ACE_HANDLE handle, iovec *iov, int iovcnt, const ACE_Time_Value *timeout=0, size_t *bytes_transferred=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::recv_n (ACE_HANDLE handle, ACE_Message_Block *message_block, const ACE_Time_Value *timeout=0, size_t *bytes_transferred=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::send (ACE_HANDLE handle, const void *buf, size_t len, int flags, const ACE_Time_Value *timeout=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::t_snd (ACE_HANDLE handle, const void *buf, size_t len, int flags, const ACE_Time_Value *timeout=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::send (ACE_HANDLE handle, const void *buf, size_t len, const ACE_Time_Value *timeout=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::sendmsg (ACE_HANDLE handle, const struct msghdr *msg, int flags, const ACE_Time_Value *timeout=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::sendto (ACE_HANDLE handle, const char *buf, int len, int flags, const struct sockaddr *addr, int addrlen, const ACE_Time_Value *timeout=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::send_n (ACE_HANDLE handle, const void *buf, size_t len, int flags, const ACE_Time_Value *timeout=0, size_t *bytes_transferred=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::t_snd_n (ACE_HANDLE handle, const void *buf, size_t len, int flags, const ACE_Time_Value *timeout=0, size_t *bytes_transferred=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::send_n (ACE_HANDLE handle, const void *buf, size_t len, const ACE_Time_Value *timeout=0, size_t *bytes_transferred=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::send (ACE_HANDLE handle, size_t n,...)
 Varargs variant. More...
 
ssize_t ACE::sendv (ACE_HANDLE handle, const iovec *iov, int iovcnt, const ACE_Time_Value *timeout=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::sendv_n (ACE_HANDLE handle, const iovec *iov, int iovcnt, const ACE_Time_Value *timeout=0, size_t *bytes_transferred=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::send_n (ACE_HANDLE handle, const ACE_Message_Block *message_block, const ACE_Time_Value *timeout=0, size_t *bytes_transferred=0)
 
ssize_t ACE::read_n (ACE_HANDLE handle, void *buf, size_t len, size_t *bytes_transferred=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::write_n (ACE_HANDLE handle, const void *buf, size_t len, size_t *bytes_transferred=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::write_n (ACE_HANDLE handle, const ACE_Message_Block *message_block, size_t *bytes_transferred=0)
 
ssize_t ACE::readv_n (ACE_HANDLE handle, iovec *iov, int iovcnt, size_t *bytes_transferred=0)
 Receive into a variable number of pieces. More...
 
ssize_t ACE::writev_n (ACE_HANDLE handle, const iovec *iov, int iovcnt, size_t *bytes_transferred=0)
 Receive into a variable number of pieces. More...
 

Detailed Description

Id:
ACE.h 97308 2013-09-01 00:58:08Z mesnier_p

This file contains value added ACE functions that extend the behavior of the UNIX and Win32 OS calls.

All these ACE static functions are consolidated in a single place in order to manage the namespace better. These functions are put here rather than in ACE_OS in order to separate concerns.

Author
Douglas C. Schmidt schmi.nosp@m.dt@c.nosp@m.s.wus.nosp@m.tl.e.nosp@m.du

Macro Definition Documentation

#define ACE_EXPORT_MACRO   ACE_Export