summaryrefslogtreecommitdiff
path: root/ACE/ace/SOCK_Dgram.h
diff options
context:
space:
mode:
authorJustin R. Wilson <wilsonj@objectcomputing.com>2019-02-21 09:22:09 -0600
committerJustin R. Wilson <wilsonj@objectcomputing.com>2019-02-22 09:48:09 -0600
commitfa2ecd983d5a4f844b9ee419bcd73edc23d1408c (patch)
tree6f2a41f3735521a4920b6c4a580076e0d0c8aa70 /ACE/ace/SOCK_Dgram.h
parentb584d571ee82182fb39a572f24fd8083e50eb0ec (diff)
downloadATCD-fa2ecd983d5a4f844b9ee419bcd73edc23d1408c.tar.gz
Provide option for local address for SOCK_Dgram recvmsg
Diffstat (limited to 'ACE/ace/SOCK_Dgram.h')
-rw-r--r--ACE/ace/SOCK_Dgram.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/ACE/ace/SOCK_Dgram.h b/ACE/ace/SOCK_Dgram.h
index 92705f2aa56..ff567997592 100644
--- a/ACE/ace/SOCK_Dgram.h
+++ b/ACE/ace/SOCK_Dgram.h
@@ -15,6 +15,9 @@
#include "ace/SOCK.h"
#include "ace/INET_Addr.h"
+// Included so users have access to ACE_RECVPKTINFO and ACE_RECVPKTINFO6 .
+#include "ace/OS_NS_sys_socket.h"
+
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
@@ -120,11 +123,16 @@ public:
int flags = 0) const;
/// Recv an <iovec> of size @a n to the datagram socket (uses
- /// <recvmsg(3)>).
+ /// <recvmsg(3)>). The IP destination address will be placed in @a
+ /// *to_addr if it is not null and set_option has been called with
+ /// 1) level IPPROTO_IP, option ACE_RECVPKTINFO, and value 1 for
+ /// IPV4 addresses or 2) IPPROTO_IPV6, option ACE_RECVPKTINFO6, and
+ /// value 1 for IPV6 addresses.
ssize_t recv (iovec iov[],
int n,
ACE_Addr &addr,
- int flags = 0) const;
+ int flags = 0,
+ ACE_INET_Addr *to_addr = 0) const;
/**
* Wait up to @a timeout amount of time to receive a datagram into