On Tuesday, 14 January 2014 at 03:42:29 UTC, APott wrote:
byte[] buffer;
client.receive(buffer);

These lines are wrong: receive needs a pre-allocated buffer with a certain size and it tries to fill it. Also generally ubyte is better for this than byte.

ubyte[1024] buffer;
auto got= client.receive(buffer);

if(got < 0) throw new Exception("error");
if(got == 0) writeln("end of file)
else auto receivedInfo = buffer[0 .. got]; /* use received info */

Reply via email to