MCPcopy Create free account
hub / github.com/3rdparty/libprocess / send

Method send

src/windows/poll_socket.cpp:178–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176
177
178Future<size_t> PollSocketImpl::send(const char* data, size_t size)
179{
180 CHECK(size > 0); // TODO(benh): Just return 0 if `size` is 0?
181
182 // Need to hold a copy of `this` so that the underlying socket
183 // doesn't end up getting reused before we return.
184 auto self = shared(this);
185
186 // TODO(benh): Reuse `io::write`? Or is `net::send` and
187 // `MSG_NOSIGNAL` critical here?
188 return io::write(get(), data, size).then([self](size_t length) {
189 return length;
190 });
191}
192
193
194Future<size_t> PollSocketImpl::sendfile(int_fd fd, off_t offset, size_t size)

Callers

nothing calls this directly

Calls 3

getFunction · 0.85
writeFunction · 0.70
thenMethod · 0.45

Tested by

no test coverage detected