#include "ace/Sock_Connect.h"
#include "ace/INET_Addr.h"
#include "ace/Log_Msg.h"
#include "ace/Handle_Set.h"
#include "ace/Auto_Ptr.h"
#include "ace/SString.h"
#include "ace/OS_Memory.h"
#include "ace/OS_NS_stdio.h"
#include "ace/ACE.h"
#include "ace/OS_NS_stdlib.h"
#include "ace/OS_NS_string.h"
#include "ace/OS_NS_sys_socket.h"
#include "ace/OS_NS_netdb.h"
#include "ace/OS_NS_unistd.h"
#include "ace/os_include/net/os_if.h"
Go to the source code of this file.
Defines | |
#define | SIOCGIFCONF_CMD SIOCGIFCONF |
#define | IFREQ ifreq |
#define | IFCONF ifconf |
#define | IFC_REQ ifc_req |
#define | IFC_LEN ifc_len |
#define | IFC_BUF ifc_buf |
#define | IFR_ADDR ifr_addr |
#define | IFR_NAME ifr_name |
#define | IFR_FLAGS ifr_flags |
#define | SA_FAMILY sa_family |
Functions | |
ACE_RCSID (ace, Sock_Connect,"$Id: Sock_Connect.cpp 90399 2010-06-03 21:35:20Z mesnier_p $") 1int ACE |
#define IFC_BUF ifc_buf |
Definition at line 141 of file Sock_Connect.cpp.
#define IFC_LEN ifc_len |
Definition at line 140 of file Sock_Connect.cpp.
#define IFC_REQ ifc_req |
Definition at line 139 of file Sock_Connect.cpp.
#define IFCONF ifconf |
Definition at line 138 of file Sock_Connect.cpp.
#define IFR_ADDR ifr_addr |
Definition at line 142 of file Sock_Connect.cpp.
#define IFR_FLAGS ifr_flags |
Definition at line 144 of file Sock_Connect.cpp.
#define IFR_NAME ifr_name |
Definition at line 143 of file Sock_Connect.cpp.
#define IFREQ ifreq |
Definition at line 137 of file Sock_Connect.cpp.
#define SA_FAMILY sa_family |
Definition at line 146 of file Sock_Connect.cpp.
#define SIOCGIFCONF_CMD SIOCGIFCONF |
Definition at line 136 of file Sock_Connect.cpp.
ACE_RCSID | ( | ace | , | |
Sock_Connect | , | |||
"$Id: Sock_Connect.cpp 90399 2010-06-03 21:35:20Z mesnier_p $" | ||||
) |
Definition at line 160 of file Sock_Connect.cpp.
: Sock_Connect.cpp 90399 2010-06-03 21:35:20Z mesnier_p $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL // Bind socket to an unused port. int ACE::bind_port (ACE_HANDLE handle, ACE_UINT32 ip_addr, int address_family) { ACE_TRACE ("ACE::bind_port"); ACE_INET_Addr addr; #if defined (ACE_HAS_IPV6) if (address_family != PF_INET6) // What do we do if it is PF_"INET6? Since it's 4 bytes, it must be an // IPV4 address. Is there a difference? Why is this test done? dhinton #else /* ACE_HAS_IPV6 */ ACE_UNUSED_ARG (address_family); #endif /* !ACE_HAS_IPV6 */ addr = ACE_INET_Addr ((u_short)0, ip_addr); #if defined (ACE_HAS_IPV6) else if (ip_addr != INADDR_ANY) // address_family == PF_INET6 and a non default IP address means to bind // to the IPv4-mapped IPv6 address addr.set ((u_short)0, ip_addr, 1, 1); #endif /* ACE_HAS_IPV6 */ // The OS kernel should select a free port for us. return ACE_OS::bind (handle, (sockaddr*)addr.get_addr(), addr.get_size()); }