Lines Matching refs:Result
60 Result Socket::open(int domain, int type, int protocol) { in open()
62 return Result::error("open called on socket in invalid state"); in open()
66 return Result::error(strerror(errno)); in open()
69 return Result::success(); in open()
72 Result Socket::setInterface(const std::string& interface) { in setInterface()
74 return Result::error("attempting to set option in invalid state"); in setInterface()
79 return res == -1 ? Result::error(strerror(errno)) : Result::success(); in setInterface()
82 Result Socket::setMulticastHopLimit(int hopLimit) { in setMulticastHopLimit()
84 return Result::error("attempting to set option in invalid state"); in setMulticastHopLimit()
89 return res == -1 ? Result::error(strerror(errno)) : Result::success(); in setMulticastHopLimit()
92 Result Socket::setUnicastHopLimit(int hopLimit) { in setUnicastHopLimit()
94 return Result::error("attempting to set option in invalid state"); in setUnicastHopLimit()
99 return res == -1 ? Result::error(strerror(errno)) : Result::success(); in setUnicastHopLimit()
102 Result Socket::setTransparent(bool transparent) { in setTransparent()
104 return Result::error("attempting to set option in invalid state"); in setTransparent()
110 return res == -1 ? Result::error(strerror(errno)) : Result::success(); in setTransparent()
113 Result Socket::bind(const Address& address) { in bind()
115 return Result::error("bind called on socket in invalid state"); in bind()
120 return Result::error(strerror(errno)); in bind()
124 return Result::success(); in bind()
127 Result Socket::receive(Message* receivingMessage) { in receive()
129 return Result::error("No receivingMessage provided"); in receive()
132 return Result::error("Attempt to receive on a socket that isn't bound"); in receive()
140 return Result::error(strerror(errno)); in receive()
144 return Result::success(); in receive()
147 Result Socket::receiveFrom(Message* receivingMessage, Address* from) { in receiveFrom()
149 return Result::error("No receivingMessage provided"); in receiveFrom()
152 return Result::error("No from address provided"); in receiveFrom()
155 return Result::error("Attempt to receive on a socket that isn't bound"); in receiveFrom()
168 return Result::error(strerror(errno)); in receiveFrom()
172 return Result::success(); in receiveFrom()
175 Result Socket::send(const void* data, size_t size) { in send()
177 return Result::error("Attempt to send on a socket in invalid state"); in send()
182 return Result::error(strerror(errno)); in send()
184 return Result::success(); in send()
187 Result Socket::sendTo(const sockaddr& destination, in sendTo()
192 return Result::error("Attempt to send on a socket in invalid state"); in sendTo()
197 return Result::error(strerror(errno)); in sendTo()
199 return Result::success(); in sendTo()
202 Result Socket::sendTo(const in6_addr& destination, in sendTo()
215 Result Socket::sendFrom(const struct in6_addr& fromAddress, in sendFrom()
253 return Result::error(strerror(error)); in sendFrom()
255 return Result::success(); in sendFrom()
258 Result Socket::sendFrom(const in6_addr& fromAddress, in sendFrom()