| 1779 | Future<Nothing> _send(Encoder* encoder, Socket socket); |
| 1780 | |
| 1781 | void send(Encoder* encoder, Socket socket) |
| 1782 | { |
| 1783 | _send(encoder, socket) |
| 1784 | .then([socket] { |
| 1785 | // Continue sending until this socket has no more |
| 1786 | // queued outgoing messages. |
| 1787 | return process::loop( |
| 1788 | None(), |
| 1789 | [=] { return socket_manager->next(socket); }, |
| 1790 | [=](Encoder* encoder) -> Future<ControlFlow<Nothing>> { |
| 1791 | if (encoder == nullptr) { |
| 1792 | return Break(); |
| 1793 | } |
| 1794 | |
| 1795 | return _send(encoder, socket) |
| 1796 | .then([]() -> ControlFlow<Nothing> { return Continue(); }); |
| 1797 | }); |
| 1798 | }); |
| 1799 | } |
| 1800 | |
| 1801 | |
| 1802 | Future<Nothing> _send(Encoder* encoder, Socket socket) |