00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef ACE_SOCK_DGRAM_BCAST_H
00015 #define ACE_SOCK_DGRAM_BCAST_H
00016 #include "ace/pre.h"
00017
00018 #include "ace/INET_Addr.h"
00019
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif
00023
00024 #include "ace/SOCK_Dgram.h"
00025
00026
00027
00028
00029
00030
00031 class ACE_Export ACE_Bcast_Node
00032 {
00033 public:
00034
00035 ACE_Bcast_Node (ACE_INET_Addr &,
00036 ACE_Bcast_Node *);
00037
00038
00039 ~ACE_Bcast_Node (void);
00040
00041
00042 ACE_INET_Addr bcast_addr_;
00043
00044
00045 ACE_Bcast_Node *next_;
00046 };
00047
00048
00049
00050
00051
00052
00053
00054 class ACE_Export ACE_SOCK_Dgram_Bcast : public ACE_SOCK_Dgram
00055 {
00056 public:
00057
00058
00059 ACE_SOCK_Dgram_Bcast (void);
00060
00061 ACE_SOCK_Dgram_Bcast (const ACE_Addr &local,
00062 int protocol_family = PF_INET,
00063 int protocol = 0,
00064 int reuse_addr = 0,
00065 const ACE_TCHAR *host_name = 0);
00066
00067
00068 ~ACE_SOCK_Dgram_Bcast (void);
00069
00070
00071
00072
00073 int open (const ACE_Addr &local,
00074 int protocol_family = PF_INET,
00075 int protocol = 0,
00076 int reuse_addr = 0,
00077 const ACE_TCHAR *host_name = 0);
00078
00079
00080 int close (void);
00081
00082
00083
00084 ssize_t send (const void *buf,
00085 size_t n,
00086 u_short portnum,
00087 int flags = 0) const;
00088
00089
00090
00091 ssize_t send (const iovec iov[],
00092 int n,
00093 u_short portnum,
00094 int flags = 0) const;
00095
00096
00097
00098 ssize_t send (const void *buf,
00099 size_t n,
00100 const ACE_Addr &addr,
00101 int flags = 0) const;
00102
00103
00104
00105
00106
00107
00108 ssize_t send (const iovec iov[],
00109 int n,
00110 const ACE_Addr &addr,
00111 int flags = 0) const;
00112
00113
00114 void dump (void) const;
00115
00116
00117 ACE_ALLOC_HOOK_DECLARE;
00118
00119 private:
00120
00121 int mk_broadcast (const ACE_TCHAR *host_name);
00122
00123
00124 ACE_Bcast_Node *if_list_;
00125
00126
00127 int get_remote_addr (ACE_Addr &) const;
00128 };
00129
00130 #if !defined (ACE_LACKS_INLINE_FUNCTIONS)
00131 #include "ace/SOCK_Dgram_Bcast.i"
00132 #endif
00133
00134 #include "ace/post.h"
00135 #endif