while (lines (process.std_out, process.std_err))
{
  if (bytes_exists, { _ = peek_socket (process.std_out) })
  {
    ...
  }

  if (bytes_exists, { _ = peek_socket (process.std_err) })
  {
    ...
  }
}