3 //=============================================================================
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
9 //=============================================================================
13 #include /**/ "ace/pre.h"
15 #include /**/ "ace/ACE_export.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "ace/IPC_SAP.h"
23 #include "ace/OS_NS_stropts.h"
25 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
30 * @brief An abstract class that forms the basis for more specific
31 * classes, such as ACE_SOCK_Acceptor and ACE_SOCK_Stream.
32 * Do not instantiate this class.
34 * This class provides functions that are common to all of the
35 * <ACE_SOCK_*> classes. ACE_SOCK provides the ability to get
36 * and set socket options, get the local and remote addresses,
37 * and open and close a socket handle.
39 class ACE_Export ACE_SOCK
: public ACE_IPC_SAP
42 /// Wrapper around the @c setsockopt system call.
43 int set_option (int level
,
48 /// Wrapper around the @c getsockopt system call.
49 int get_option (int level
,
56 * This method also sets the object's handle value to ACE_INVALID_HANDLE.
58 * @return The result of closing the socket; 0 if the handle value
59 * was already ACE_INVALID_HANDLE.
63 /// Return the local endpoint address in the referenced ACE_Addr.
64 /// Returns 0 if successful, else -1.
65 int get_local_addr (ACE_Addr
&) const;
68 * Return the address of the remotely connected peer (if there is
69 * one), in the referenced ACE_Addr. Returns 0 if successful, else
72 int get_remote_addr (ACE_Addr
&) const;
74 /// Dump the state of an object.
77 /// Declare the dynamic allocation hooks.
78 ACE_ALLOC_HOOK_DECLARE
;
80 /// Wrapper around the BSD-style @c socket system call (no QoS).
86 /// Wrapper around the QoS-enabled @c WSASocket function.
90 ACE_Protocol_Info
*protocolinfo
,
96 /// Constructor with arguments to call the BSD-style @c socket system
103 /// Constructor with arguments to call the QoS-enabled @c WSASocket
108 ACE_Protocol_Info
*protocolinfo
,
113 /// Default constructor is protected to prevent instances of this class
114 /// from being defined.
117 /// Protected destructor.
119 * Not a virtual destructor. Protected destructor to prevent
120 * operator delete() from being called through a base class ACE_SOCK
123 ~ACE_SOCK () = default;
126 ACE_END_VERSIONED_NAMESPACE_DECL
128 #if defined (__ACE_INLINE__)
129 #include "ace/SOCK.inl"
130 #endif /* __ACE_INLINE__ */
132 #include /**/ "ace/post.h"
133 #endif /* ACE_SOCK_H */