Socket.send

Andrea Fontana advmail at katamail.com
Tue Sep 27 03:20:32 PDT 2011


It's a small server (http) so I don't wait for any reply from the
client. If there's an header "connection: close", server should
close connection when data is sent.

So on server side i should write:

if (httpRequest.isCompleted)
{
   // Parsing request headers
   [... omitted ...]
   // Build http reply
   [... omitted ...]

   socket.send(reply);
   socket.shutdown(SocketShutdown.BOTH);
}


and then wait for client to close connection?



More information about the Digitalmars-d mailing list