mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-25 09:51:17 +08:00
Change the send message size
This commit is contained in:
parent
e5354fcddb
commit
e94f0028c3
@ -170,10 +170,17 @@ struct GroupImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void send(const char* buf, size_t len, int dst) {
|
void send(const char* buf, size_t len, int dst) {
|
||||||
ssize_t r = sendto(
|
while (len > 0) {
|
||||||
socket_fd_, buf, len, 0, peers_[dst].sockaddr(), peers_[dst].len);
|
size_t l = std::min(len, 8192ul);
|
||||||
if (r < 0) {
|
ssize_t r = sendto(
|
||||||
throw std::runtime_error("Send failed.");
|
socket_fd_, buf, l, 0, peers_[dst].sockaddr(), peers_[dst].len);
|
||||||
|
if (r <= 0) {
|
||||||
|
std::ostringstream msg;
|
||||||
|
msg << "Send of " << l << " bytes failed (errno: " << errno << ")";
|
||||||
|
throw std::runtime_error(msg.str());
|
||||||
|
}
|
||||||
|
len -= l;
|
||||||
|
buf += l;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user