Re: Socket: The connection was reset

2012-02-10 Thread nrgyzer
Works perfectly, thanks :) But... how can I read the complete HTTP-header? When I try the following: string header; ubyte[1024] buffer; while (cs.receive(buffer)) header ~= buffer; ... it works as long as the header doesn't have a length like 1024, 2048, 3072... Otherwise

Re: Socket: The connection was reset

2012-02-10 Thread DNewbie
nrgyzer, please check the return value of 'receive'. http://dlang.org/phobos/std_socket.html#receive On Fri, Feb 10, 2012, at 02:06 PM, nrgyzer wrote: Works perfectly, thanks :) But... how can I read the complete HTTP-header? When I try the following: string header;

Re: Socket: The connection was reset

2012-02-10 Thread nrgyzer
Yep, thanks... but I already checked out the return value and the problem is If the socket is blocking, receive waits until there is data to be received.. The following socket blocks and the server doesn't respond: while(true) { Socket cs = s.accept(); ubyte[] header;

Re: Socket: The connection was reset

2012-02-09 Thread DNewbie
Try this while(true) { Socket cs = s.accept(); cs.receive(new byte[1024]); cs.sendTo(HTTP/1.1 200 OK\r\nContent-Length: 11\r\n\r\nHello World); cs.close(); } On Thu, Feb 9, 2012, at 07:31 PM, Nrgyzer wrote: Hi