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