Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1168)

Side by Side Diff: runtime/bin/socket_base_fuchsia.cc

Issue 2974233002: VM: Re-format to use at most one newline between functions (Closed)
Patch Set: Rebase and merge Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/bin/socket_base_android.cc ('k') | runtime/bin/socket_base_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #if !defined(DART_IO_DISABLED) 5 #if !defined(DART_IO_DISABLED)
6 6
7 #include "platform/globals.h" 7 #include "platform/globals.h"
8 #if defined(HOST_OS_FUCHSIA) 8 #if defined(HOST_OS_FUCHSIA)
9 9
10 #include "bin/socket_base.h" 10 #include "bin/socket_base.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 SocketAddress::SocketAddress(struct sockaddr* sa) { 60 SocketAddress::SocketAddress(struct sockaddr* sa) {
61 ASSERT(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN); 61 ASSERT(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN);
62 if (!SocketBase::FormatNumericAddress(*reinterpret_cast<RawAddr*>(sa), 62 if (!SocketBase::FormatNumericAddress(*reinterpret_cast<RawAddr*>(sa),
63 as_string_, INET6_ADDRSTRLEN)) { 63 as_string_, INET6_ADDRSTRLEN)) {
64 as_string_[0] = 0; 64 as_string_[0] = 0;
65 } 65 }
66 socklen_t salen = GetAddrLength(*reinterpret_cast<RawAddr*>(sa)); 66 socklen_t salen = GetAddrLength(*reinterpret_cast<RawAddr*>(sa));
67 memmove(reinterpret_cast<void*>(&addr_), sa, salen); 67 memmove(reinterpret_cast<void*>(&addr_), sa, salen);
68 } 68 }
69 69
70
71 bool SocketBase::Initialize() { 70 bool SocketBase::Initialize() {
72 // Nothing to do on Fuchsia. 71 // Nothing to do on Fuchsia.
73 return true; 72 return true;
74 } 73 }
75 74
76
77 bool SocketBase::FormatNumericAddress(const RawAddr& addr, 75 bool SocketBase::FormatNumericAddress(const RawAddr& addr,
78 char* address, 76 char* address,
79 int len) { 77 int len) {
80 socklen_t salen = SocketAddress::GetAddrLength(addr); 78 socklen_t salen = SocketAddress::GetAddrLength(addr);
81 LOG_INFO("SocketBase::FormatNumericAddress: calling getnameinfo\n"); 79 LOG_INFO("SocketBase::FormatNumericAddress: calling getnameinfo\n");
82 return (NO_RETRY_EXPECTED(getnameinfo(&addr.addr, salen, address, len, NULL, 80 return (NO_RETRY_EXPECTED(getnameinfo(&addr.addr, salen, address, len, NULL,
83 0, NI_NUMERICHOST) == 0)); 81 0, NI_NUMERICHOST) == 0));
84 } 82 }
85 83
86
87 bool SocketBase::IsBindError(intptr_t error_number) { 84 bool SocketBase::IsBindError(intptr_t error_number) {
88 return error_number == EADDRINUSE || error_number == EADDRNOTAVAIL || 85 return error_number == EADDRINUSE || error_number == EADDRNOTAVAIL ||
89 error_number == EINVAL; 86 error_number == EINVAL;
90 } 87 }
91 88
92
93 intptr_t SocketBase::Available(intptr_t fd) { 89 intptr_t SocketBase::Available(intptr_t fd) {
94 IOHandle* handle = reinterpret_cast<IOHandle*>(fd); 90 IOHandle* handle = reinterpret_cast<IOHandle*>(fd);
95 ASSERT(handle->fd() >= 0); 91 ASSERT(handle->fd() >= 0);
96 intptr_t available = FDUtils::AvailableBytes(handle->fd()); 92 intptr_t available = FDUtils::AvailableBytes(handle->fd());
97 LOG_INFO("SocketBase::Available(%ld) = %ld\n", handle->fd(), available); 93 LOG_INFO("SocketBase::Available(%ld) = %ld\n", handle->fd(), available);
98 return available; 94 return available;
99 } 95 }
100 96
101
102 intptr_t SocketBase::Read(intptr_t fd, 97 intptr_t SocketBase::Read(intptr_t fd,
103 void* buffer, 98 void* buffer,
104 intptr_t num_bytes, 99 intptr_t num_bytes,
105 SocketOpKind sync) { 100 SocketOpKind sync) {
106 IOHandle* handle = reinterpret_cast<IOHandle*>(fd); 101 IOHandle* handle = reinterpret_cast<IOHandle*>(fd);
107 ASSERT(handle->fd() >= 0); 102 ASSERT(handle->fd() >= 0);
108 LOG_INFO("SocketBase::Read: calling read(%ld, %p, %ld)\n", handle->fd(), 103 LOG_INFO("SocketBase::Read: calling read(%ld, %p, %ld)\n", handle->fd(),
109 buffer, num_bytes); 104 buffer, num_bytes);
110 intptr_t read_bytes = handle->Read(buffer, num_bytes); 105 intptr_t read_bytes = handle->Read(buffer, num_bytes);
111 ASSERT(EAGAIN == EWOULDBLOCK); 106 ASSERT(EAGAIN == EWOULDBLOCK);
112 if ((sync == kAsync) && (read_bytes == -1) && (errno == EWOULDBLOCK)) { 107 if ((sync == kAsync) && (read_bytes == -1) && (errno == EWOULDBLOCK)) {
113 // If the read would block we need to retry and therefore return 0 108 // If the read would block we need to retry and therefore return 0
114 // as the number of bytes written. 109 // as the number of bytes written.
115 read_bytes = 0; 110 read_bytes = 0;
116 } else if (read_bytes == -1) { 111 } else if (read_bytes == -1) {
117 LOG_ERR("SocketBase::Read: read(%ld, %p, %ld) failed\n", handle->fd(), 112 LOG_ERR("SocketBase::Read: read(%ld, %p, %ld) failed\n", handle->fd(),
118 buffer, num_bytes); 113 buffer, num_bytes);
119 } else { 114 } else {
120 LOG_INFO("SocketBase::Read: read(%ld, %p, %ld) succeeded\n", handle->fd(), 115 LOG_INFO("SocketBase::Read: read(%ld, %p, %ld) succeeded\n", handle->fd(),
121 buffer, num_bytes); 116 buffer, num_bytes);
122 } 117 }
123 return read_bytes; 118 return read_bytes;
124 } 119 }
125 120
126
127 intptr_t SocketBase::RecvFrom(intptr_t fd, 121 intptr_t SocketBase::RecvFrom(intptr_t fd,
128 void* buffer, 122 void* buffer,
129 intptr_t num_bytes, 123 intptr_t num_bytes,
130 RawAddr* addr, 124 RawAddr* addr,
131 SocketOpKind sync) { 125 SocketOpKind sync) {
132 LOG_ERR("SocketBase::RecvFrom is unimplemented\n"); 126 LOG_ERR("SocketBase::RecvFrom is unimplemented\n");
133 UNIMPLEMENTED(); 127 UNIMPLEMENTED();
134 return -1; 128 return -1;
135 } 129 }
136 130
137
138 intptr_t SocketBase::Write(intptr_t fd, 131 intptr_t SocketBase::Write(intptr_t fd,
139 const void* buffer, 132 const void* buffer,
140 intptr_t num_bytes, 133 intptr_t num_bytes,
141 SocketOpKind sync) { 134 SocketOpKind sync) {
142 IOHandle* handle = reinterpret_cast<IOHandle*>(fd); 135 IOHandle* handle = reinterpret_cast<IOHandle*>(fd);
143 ASSERT(handle->fd() >= 0); 136 ASSERT(handle->fd() >= 0);
144 LOG_INFO("SocketBase::Write: calling write(%ld, %p, %ld)\n", handle->fd(), 137 LOG_INFO("SocketBase::Write: calling write(%ld, %p, %ld)\n", handle->fd(),
145 buffer, num_bytes); 138 buffer, num_bytes);
146 intptr_t written_bytes = handle->Write(buffer, num_bytes); 139 intptr_t written_bytes = handle->Write(buffer, num_bytes);
147 ASSERT(EAGAIN == EWOULDBLOCK); 140 ASSERT(EAGAIN == EWOULDBLOCK);
148 if ((sync == kAsync) && (written_bytes == -1) && (errno == EWOULDBLOCK)) { 141 if ((sync == kAsync) && (written_bytes == -1) && (errno == EWOULDBLOCK)) {
149 // If the would block we need to retry and therefore return 0 as 142 // If the would block we need to retry and therefore return 0 as
150 // the number of bytes written. 143 // the number of bytes written.
151 written_bytes = 0; 144 written_bytes = 0;
152 } else if (written_bytes == -1) { 145 } else if (written_bytes == -1) {
153 LOG_ERR("SocketBase::Write: write(%ld, %p, %ld) failed\n", handle->fd(), 146 LOG_ERR("SocketBase::Write: write(%ld, %p, %ld) failed\n", handle->fd(),
154 buffer, num_bytes); 147 buffer, num_bytes);
155 } else { 148 } else {
156 LOG_INFO("SocketBase::Write: write(%ld, %p, %ld) succeeded\n", handle->fd(), 149 LOG_INFO("SocketBase::Write: write(%ld, %p, %ld) succeeded\n", handle->fd(),
157 buffer, num_bytes); 150 buffer, num_bytes);
158 } 151 }
159 return written_bytes; 152 return written_bytes;
160 } 153 }
161 154
162
163 intptr_t SocketBase::SendTo(intptr_t fd, 155 intptr_t SocketBase::SendTo(intptr_t fd,
164 const void* buffer, 156 const void* buffer,
165 intptr_t num_bytes, 157 intptr_t num_bytes,
166 const RawAddr& addr, 158 const RawAddr& addr,
167 SocketOpKind sync) { 159 SocketOpKind sync) {
168 LOG_ERR("SocketBase::SendTo is unimplemented\n"); 160 LOG_ERR("SocketBase::SendTo is unimplemented\n");
169 UNIMPLEMENTED(); 161 UNIMPLEMENTED();
170 return -1; 162 return -1;
171 } 163 }
172 164
173
174 intptr_t SocketBase::GetPort(intptr_t fd) { 165 intptr_t SocketBase::GetPort(intptr_t fd) {
175 IOHandle* handle = reinterpret_cast<IOHandle*>(fd); 166 IOHandle* handle = reinterpret_cast<IOHandle*>(fd);
176 ASSERT(handle->fd() >= 0); 167 ASSERT(handle->fd() >= 0);
177 RawAddr raw; 168 RawAddr raw;
178 socklen_t size = sizeof(raw); 169 socklen_t size = sizeof(raw);
179 LOG_INFO("SocketBase::GetPort: calling getsockname(%ld)\n", handle->fd()); 170 LOG_INFO("SocketBase::GetPort: calling getsockname(%ld)\n", handle->fd());
180 if (NO_RETRY_EXPECTED(getsockname(handle->fd(), &raw.addr, &size))) { 171 if (NO_RETRY_EXPECTED(getsockname(handle->fd(), &raw.addr, &size))) {
181 return 0; 172 return 0;
182 } 173 }
183 return SocketAddress::GetAddrPort(raw); 174 return SocketAddress::GetAddrPort(raw);
184 } 175 }
185 176
186
187 SocketAddress* SocketBase::GetRemotePeer(intptr_t fd, intptr_t* port) { 177 SocketAddress* SocketBase::GetRemotePeer(intptr_t fd, intptr_t* port) {
188 IOHandle* handle = reinterpret_cast<IOHandle*>(fd); 178 IOHandle* handle = reinterpret_cast<IOHandle*>(fd);
189 ASSERT(handle->fd() >= 0); 179 ASSERT(handle->fd() >= 0);
190 RawAddr raw; 180 RawAddr raw;
191 socklen_t size = sizeof(raw); 181 socklen_t size = sizeof(raw);
192 if (NO_RETRY_EXPECTED(getpeername(handle->fd(), &raw.addr, &size))) { 182 if (NO_RETRY_EXPECTED(getpeername(handle->fd(), &raw.addr, &size))) {
193 return NULL; 183 return NULL;
194 } 184 }
195 *port = SocketAddress::GetAddrPort(raw); 185 *port = SocketAddress::GetAddrPort(raw);
196 return new SocketAddress(&raw.addr); 186 return new SocketAddress(&raw.addr);
197 } 187 }
198 188
199
200 void SocketBase::GetError(intptr_t fd, OSError* os_error) { 189 void SocketBase::GetError(intptr_t fd, OSError* os_error) {
201 LOG_ERR("SocketBase::GetError is unimplemented\n"); 190 LOG_ERR("SocketBase::GetError is unimplemented\n");
202 UNIMPLEMENTED(); 191 UNIMPLEMENTED();
203 } 192 }
204 193
205
206 int SocketBase::GetType(intptr_t fd) { 194 int SocketBase::GetType(intptr_t fd) {
207 LOG_ERR("SocketBase::GetType is unimplemented\n"); 195 LOG_ERR("SocketBase::GetType is unimplemented\n");
208 UNIMPLEMENTED(); 196 UNIMPLEMENTED();
209 return File::kOther; 197 return File::kOther;
210 } 198 }
211 199
212
213 intptr_t SocketBase::GetStdioHandle(intptr_t num) { 200 intptr_t SocketBase::GetStdioHandle(intptr_t num) {
214 LOG_ERR("SocketBase::GetStdioHandle is unimplemented\n"); 201 LOG_ERR("SocketBase::GetStdioHandle is unimplemented\n");
215 UNIMPLEMENTED(); 202 UNIMPLEMENTED();
216 return num; 203 return num;
217 } 204 }
218 205
219
220 AddressList<SocketAddress>* SocketBase::LookupAddress(const char* host, 206 AddressList<SocketAddress>* SocketBase::LookupAddress(const char* host,
221 int type, 207 int type,
222 OSError** os_error) { 208 OSError** os_error) {
223 // Perform a name lookup for a host name. 209 // Perform a name lookup for a host name.
224 struct addrinfo hints; 210 struct addrinfo hints;
225 memset(&hints, 0, sizeof(hints)); 211 memset(&hints, 0, sizeof(hints));
226 hints.ai_family = SocketAddress::FromType(type); 212 hints.ai_family = SocketAddress::FromType(type);
227 hints.ai_socktype = SOCK_STREAM; 213 hints.ai_socktype = SOCK_STREAM;
228 hints.ai_flags = AI_ADDRCONFIG; 214 hints.ai_flags = AI_ADDRCONFIG;
229 hints.ai_protocol = IPPROTO_TCP; 215 hints.ai_protocol = IPPROTO_TCP;
(...skipping 24 matching lines...) Expand all
254 for (struct addrinfo* c = info; c != NULL; c = c->ai_next) { 240 for (struct addrinfo* c = info; c != NULL; c = c->ai_next) {
255 if ((c->ai_family == AF_INET) || (c->ai_family == AF_INET6)) { 241 if ((c->ai_family == AF_INET) || (c->ai_family == AF_INET6)) {
256 addresses->SetAt(i, new SocketAddress(c->ai_addr)); 242 addresses->SetAt(i, new SocketAddress(c->ai_addr));
257 i++; 243 i++;
258 } 244 }
259 } 245 }
260 freeaddrinfo(info); 246 freeaddrinfo(info);
261 return addresses; 247 return addresses;
262 } 248 }
263 249
264
265 bool SocketBase::ReverseLookup(const RawAddr& addr, 250 bool SocketBase::ReverseLookup(const RawAddr& addr,
266 char* host, 251 char* host,
267 intptr_t host_len, 252 intptr_t host_len,
268 OSError** os_error) { 253 OSError** os_error) {
269 LOG_ERR("SocketBase::ReverseLookup is unimplemented\n"); 254 LOG_ERR("SocketBase::ReverseLookup is unimplemented\n");
270 UNIMPLEMENTED(); 255 UNIMPLEMENTED();
271 return false; 256 return false;
272 } 257 }
273 258
274
275 bool SocketBase::ParseAddress(int type, const char* address, RawAddr* addr) { 259 bool SocketBase::ParseAddress(int type, const char* address, RawAddr* addr) {
276 int result; 260 int result;
277 if (type == SocketAddress::TYPE_IPV4) { 261 if (type == SocketAddress::TYPE_IPV4) {
278 result = NO_RETRY_EXPECTED(inet_pton(AF_INET, address, &addr->in.sin_addr)); 262 result = NO_RETRY_EXPECTED(inet_pton(AF_INET, address, &addr->in.sin_addr));
279 } else { 263 } else {
280 ASSERT(type == SocketAddress::TYPE_IPV6); 264 ASSERT(type == SocketAddress::TYPE_IPV6);
281 result = 265 result =
282 NO_RETRY_EXPECTED(inet_pton(AF_INET6, address, &addr->in6.sin6_addr)); 266 NO_RETRY_EXPECTED(inet_pton(AF_INET6, address, &addr->in6.sin6_addr));
283 } 267 }
284 return (result == 1); 268 return (result == 1);
285 } 269 }
286 270
287
288 static bool ShouldIncludeIfaAddrs(netc_if_info_t* if_info, int lookup_family) { 271 static bool ShouldIncludeIfaAddrs(netc_if_info_t* if_info, int lookup_family) {
289 const int family = if_info->addr.ss_family; 272 const int family = if_info->addr.ss_family;
290 return ((lookup_family == family) || 273 return ((lookup_family == family) ||
291 (((lookup_family == AF_UNSPEC) && 274 (((lookup_family == AF_UNSPEC) &&
292 ((family == AF_INET) || (family == AF_INET6))))); 275 ((family == AF_INET) || (family == AF_INET6)))));
293 } 276 }
294 277
295
296 bool SocketBase::ListInterfacesSupported() { 278 bool SocketBase::ListInterfacesSupported() {
297 return true; 279 return true;
298 } 280 }
299 281
300
301 AddressList<InterfaceSocketAddress>* SocketBase::ListInterfaces( 282 AddressList<InterfaceSocketAddress>* SocketBase::ListInterfaces(
302 int type, 283 int type,
303 OSError** os_error) { 284 OSError** os_error) {
304 // We need a dummy socket. 285 // We need a dummy socket.
305 const int fd = socket(AF_INET6, SOCK_STREAM, 0); 286 const int fd = socket(AF_INET6, SOCK_STREAM, 0);
306 if (fd < 0) { 287 if (fd < 0) {
307 LOG_ERR("ListInterfaces: socket(AF_INET, SOCK_DGRAM, 0) failed\n"); 288 LOG_ERR("ListInterfaces: socket(AF_INET, SOCK_DGRAM, 0) failed\n");
308 return NULL; 289 return NULL;
309 } 290 }
310 291
(...skipping 25 matching lines...) Expand all
336 reinterpret_cast<struct sockaddr*>(&get_if_info.info[i].addr), 317 reinterpret_cast<struct sockaddr*>(&get_if_info.info[i].addr),
337 ifa_name, if_nametoindex(get_if_info.info[i].name)); 318 ifa_name, if_nametoindex(get_if_info.info[i].name));
338 addresses->SetAt(addresses_idx, isa); 319 addresses->SetAt(addresses_idx, isa);
339 addresses_idx++; 320 addresses_idx++;
340 } 321 }
341 } 322 }
342 close(fd); 323 close(fd);
343 return addresses; 324 return addresses;
344 } 325 }
345 326
346
347 void SocketBase::Close(intptr_t fd) { 327 void SocketBase::Close(intptr_t fd) {
348 IOHandle* handle = reinterpret_cast<IOHandle*>(fd); 328 IOHandle* handle = reinterpret_cast<IOHandle*>(fd);
349 ASSERT(handle->fd() >= 0); 329 ASSERT(handle->fd() >= 0);
350 NO_RETRY_EXPECTED(close(handle->fd())); 330 NO_RETRY_EXPECTED(close(handle->fd()));
351 } 331 }
352 332
353
354 bool SocketBase::GetNoDelay(intptr_t fd, bool* enabled) { 333 bool SocketBase::GetNoDelay(intptr_t fd, bool* enabled) {
355 LOG_ERR("SocketBase::GetNoDelay is unimplemented\n"); 334 LOG_ERR("SocketBase::GetNoDelay is unimplemented\n");
356 UNIMPLEMENTED(); 335 UNIMPLEMENTED();
357 return false; 336 return false;
358 } 337 }
359 338
360
361 bool SocketBase::SetNoDelay(intptr_t fd, bool enabled) { 339 bool SocketBase::SetNoDelay(intptr_t fd, bool enabled) {
362 IOHandle* handle = reinterpret_cast<IOHandle*>(fd); 340 IOHandle* handle = reinterpret_cast<IOHandle*>(fd);
363 int on = enabled ? 1 : 0; 341 int on = enabled ? 1 : 0;
364 return NO_RETRY_EXPECTED(setsockopt(handle->fd(), IPPROTO_TCP, TCP_NODELAY, 342 return NO_RETRY_EXPECTED(setsockopt(handle->fd(), IPPROTO_TCP, TCP_NODELAY,
365 reinterpret_cast<char*>(&on), 343 reinterpret_cast<char*>(&on),
366 sizeof(on))) == 0; 344 sizeof(on))) == 0;
367 } 345 }
368 346
369
370 bool SocketBase::GetMulticastLoop(intptr_t fd, 347 bool SocketBase::GetMulticastLoop(intptr_t fd,
371 intptr_t protocol, 348 intptr_t protocol,
372 bool* enabled) { 349 bool* enabled) {
373 LOG_ERR("SocketBase::GetMulticastLoop is unimplemented\n"); 350 LOG_ERR("SocketBase::GetMulticastLoop is unimplemented\n");
374 UNIMPLEMENTED(); 351 UNIMPLEMENTED();
375 return false; 352 return false;
376 } 353 }
377 354
378
379 bool SocketBase::SetMulticastLoop(intptr_t fd, 355 bool SocketBase::SetMulticastLoop(intptr_t fd,
380 intptr_t protocol, 356 intptr_t protocol,
381 bool enabled) { 357 bool enabled) {
382 LOG_ERR("SocketBase::SetMulticastLoop is unimplemented\n"); 358 LOG_ERR("SocketBase::SetMulticastLoop is unimplemented\n");
383 UNIMPLEMENTED(); 359 UNIMPLEMENTED();
384 return false; 360 return false;
385 } 361 }
386 362
387
388 bool SocketBase::GetMulticastHops(intptr_t fd, intptr_t protocol, int* value) { 363 bool SocketBase::GetMulticastHops(intptr_t fd, intptr_t protocol, int* value) {
389 LOG_ERR("SocketBase::GetMulticastHops is unimplemented\n"); 364 LOG_ERR("SocketBase::GetMulticastHops is unimplemented\n");
390 UNIMPLEMENTED(); 365 UNIMPLEMENTED();
391 return false; 366 return false;
392 } 367 }
393 368
394
395 bool SocketBase::SetMulticastHops(intptr_t fd, intptr_t protocol, int value) { 369 bool SocketBase::SetMulticastHops(intptr_t fd, intptr_t protocol, int value) {
396 LOG_ERR("SocketBase::SetMulticastHops is unimplemented\n"); 370 LOG_ERR("SocketBase::SetMulticastHops is unimplemented\n");
397 UNIMPLEMENTED(); 371 UNIMPLEMENTED();
398 return false; 372 return false;
399 } 373 }
400 374
401
402 bool SocketBase::GetBroadcast(intptr_t fd, bool* enabled) { 375 bool SocketBase::GetBroadcast(intptr_t fd, bool* enabled) {
403 LOG_ERR("SocketBase::GetBroadcast is unimplemented\n"); 376 LOG_ERR("SocketBase::GetBroadcast is unimplemented\n");
404 UNIMPLEMENTED(); 377 UNIMPLEMENTED();
405 return false; 378 return false;
406 } 379 }
407 380
408
409 bool SocketBase::SetBroadcast(intptr_t fd, bool enabled) { 381 bool SocketBase::SetBroadcast(intptr_t fd, bool enabled) {
410 LOG_ERR("SocketBase::SetBroadcast is unimplemented\n"); 382 LOG_ERR("SocketBase::SetBroadcast is unimplemented\n");
411 UNIMPLEMENTED(); 383 UNIMPLEMENTED();
412 return false; 384 return false;
413 } 385 }
414 386
415
416 bool SocketBase::JoinMulticast(intptr_t fd, 387 bool SocketBase::JoinMulticast(intptr_t fd,
417 const RawAddr& addr, 388 const RawAddr& addr,
418 const RawAddr&, 389 const RawAddr&,
419 int interfaceIndex) { 390 int interfaceIndex) {
420 LOG_ERR("SocketBase::JoinMulticast is unimplemented\n"); 391 LOG_ERR("SocketBase::JoinMulticast is unimplemented\n");
421 UNIMPLEMENTED(); 392 UNIMPLEMENTED();
422 return false; 393 return false;
423 } 394 }
424 395
425
426 bool SocketBase::LeaveMulticast(intptr_t fd, 396 bool SocketBase::LeaveMulticast(intptr_t fd,
427 const RawAddr& addr, 397 const RawAddr& addr,
428 const RawAddr&, 398 const RawAddr&,
429 int interfaceIndex) { 399 int interfaceIndex) {
430 LOG_ERR("SocketBase::LeaveMulticast is unimplemented\n"); 400 LOG_ERR("SocketBase::LeaveMulticast is unimplemented\n");
431 UNIMPLEMENTED(); 401 UNIMPLEMENTED();
432 return false; 402 return false;
433 } 403 }
434 404
435 } // namespace bin 405 } // namespace bin
436 } // namespace dart 406 } // namespace dart
437 407
438 #endif // defined(HOST_OS_FUCHSIA) 408 #endif // defined(HOST_OS_FUCHSIA)
439 409
440 #endif // !defined(DART_IO_DISABLED) 410 #endif // !defined(DART_IO_DISABLED)
OLDNEW
« no previous file with comments | « runtime/bin/socket_base_android.cc ('k') | runtime/bin/socket_base_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698