On 09/13/2014 10:17 PM, Luís Marques wrote:

Hi,

What's the easiest way to redirect all of the data from a TCPConnection to std.stdout?

Luís

There is an adapter in vibe.stream.wrapper.

import std.algorithm, std.stdio, vibe.stream.wrapper;

auto stream = connectTCP("localhost", 8080);
StreamInputRange(stream).copy(stdout.lockingTextWriter());

http://vibed.org/api/vibe.stream.wrapper/StreamInputRange
http://dlang.org/library/std/stdio/File.lockingTextWriter.html
http://dlang.org/library/std/algorithm/copy.html