9 #ifndef anna_comm_Socket_hpp 10 #define anna_comm_Socket_hpp 13 #include <sys/socket.h> 32 class TransportFactory;
33 class ReceiverFactory;
44 struct Domain {
enum _v { Unix = PF_UNIX, Inet = PF_INET } ; };
49 struct Type {
enum _v { Stream = SOCK_STREAM, Datagram = SOCK_DGRAM, Raw = SOCK_RAW } ; };
73 int getfd()
const {
return a_fd; }
101 bool support(
const char* transportClassName)
const ;
147 bool setBlockingMode(
const bool blockingMode) noexcept(
false);
156 bool setReuseMode(
const bool reuseMode) noexcept(
false);
187 virtual void bind() noexcept(
false);
193 virtual std::string asString()
const ;
247 void open() noexcept(false);
252 virtual
void do_close() { ::close(a_fd); }
258 virtual int do_bind(
const struct sockaddr*,
const int) noexcept(
false);
265 static const char* asText(
const Notify::_v v) ;
271 #define anna_socket_assert(a,b) \ 273 std::string msg (asString ()); \ 276 throw RuntimeException (msg, __FILE__, __LINE__); \ 279 #define anna_comm_socket_check(a,b) \ 281 std::string msg (asString ()); \ 284 throw RuntimeException (msg, errno, ANNA_FILE_LOCATION); \ Definition: INetAddress.hpp:34
Definition: Socket.hpp:57
Definition: Socket.hpp:55
const AccessPoint & getLocalAccessPoint() const
Definition: Socket.hpp:128
ReceiverFactory * getReceiverFactory()
Definition: Socket.hpp:140
Domain::_v getDomain() const
Definition: Socket.hpp:85
int a_fd
Definition: Socket.hpp:205
bool isOpened() const
Definition: Socket.hpp:114
TransportFactory * a_transportFactory
Definition: Socket.hpp:208
Definition: Socket.hpp:59
void setTransportFactory(TransportFactory *transportFactory)
Definition: Socket.hpp:162
Definition: Socket.hpp:44
TransportFactory * getTransportFactory() const
Definition: Socket.hpp:134
bool isBound() const
Definition: Socket.hpp:108
Type::_v getType() const
Definition: Socket.hpp:79
void setReceiverFactory(ReceiverFactory &receiverFactory)
Definition: Socket.hpp:168
const Domain::_v a_domain
Definition: Socket.hpp:203
AccessPoint a_localAccessPoint
Definition: Socket.hpp:206
_v
Definition: Socket.hpp:49
ReceiverFactory * a_receiverFactory
Definition: Socket.hpp:209
void setCategory(const int category)
Definition: Socket.hpp:177
_v
Definition: Socket.hpp:44
_v
Definition: Socket.hpp:56
bool a_isBound
Definition: Socket.hpp:207
Definition: Socket.hpp:39
xml::Node Node
Definition: Node.hpp:21
Definition: Socket.hpp:58
Definition: ReceiverFactory.hpp:53
const Type::_v a_type
Definition: Socket.hpp:204
Definition: Socket.hpp:49
Definition: TransportFactory.hpp:30
int getCategory() const
Definition: Socket.hpp:91
virtual bool isSecure() const
Definition: Socket.hpp:122
int a_category
Definition: Socket.hpp:210
Definition: AccessPoint.hpp:37
int getfd() const
Definition: Socket.hpp:73