00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef _VPR_SOCKET_OPTIONS_H_
00043 #define _VPR_SOCKET_OPTIONS_H_
00044
00045 #include <vpr/vprConfig.h>
00046
00047 #include <vpr/IO/Socket/InetAddr.h>
00048 #include <vpr/IO/Socket/McastReq.h>
00049 #include <vpr/Util/ReturnStatus.h>
00050
00051
00052 namespace vpr
00053 {
00054
00056 namespace SocketOptions
00057 {
00064 enum Types
00065 {
00066 Linger,
00067 ReuseAddr,
00068 KeepAlive,
00069 RecvBufferSize,
00070 SendBufferSize,
00071 IpTimeToLive,
00072 IpTypeOfService,
00073 AddMember,
00074 DropMember,
00075 Broadcast,
00076 McastInterface,
00077 McastTimeToLive,
00078 McastLoopback,
00079 NoDelay,
00080 MaxSegment
00081 };
00082
00084 enum TypeOfService
00085 {
00086 LowDelay,
00087 Throughput,
00088 Reliability,
00089 LowCost
00090 };
00091
00096 struct Linger
00097 {
00098 bool enabled;
00099 vpr::Int32 seconds;
00100 };
00101
00108 struct Data
00109 {
00110 Uint32 ip_ttl;
00111 TypeOfService type_of_service;
00112 bool reuse_addr;
00113 bool keep_alive;
00114 bool no_delay;
00115 bool broadcast;
00116 size_t max_segment;
00117 size_t recv_buffer_size;
00118 size_t send_buffer_size;
00119 struct Linger linger;
00120 InetAddr mcast_if;
00121 Uint8 mcast_ttl;
00122 Uint8 mcast_loopback;
00123 McastReq mcast_add_member;
00124 McastReq mcast_drop_member;
00125 };
00126 }
00127
00132 class VPR_CLASS_API SocketOptionWrapper
00133 {
00134 public:
00135 virtual ~SocketOptionWrapper()
00136 {
00137 ;
00138 }
00139
00140 protected:
00152 virtual vpr::ReturnStatus getOption(const vpr::SocketOptions::Types option,
00153 struct vpr::SocketOptions::Data& data) const = 0;
00154
00163 virtual vpr::ReturnStatus setOption(const vpr::SocketOptions::Types option,
00164 const struct vpr::SocketOptions::Data& data) = 0;
00165 };
00166
00167 }
00168
00169
00170 #endif