ProcessRequestHeader() public method

public ProcessRequestHeader ( ) : void
return void
        private void StartListening()
        {
            while (true)
            {
                using (IClientSocket clientSocket = new ClientSocket(ListeningSocket.Accept()))
                {
                    Log.Debug("Received request from " + clientSocket.RemoteEndPoint);

                    Log.Debug(DateTime.Now + " " + clientSocket.Available + " request bytes available");

                    int bytesReceived = DetermineBytesReceived(clientSocket.Available);
                    if (bytesReceived > 0)
                    {
                        byte[] buffer = clientSocket.Receive(bytesReceived); // Buffer probably should be larger than this.

                        using (var r = new Request(clientSocket, Encoding.UTF8.GetChars(buffer)))
                        {
                            r.ProcessRequestHeader();
                            Log.Debug(DateTime.Now + " " + r.URL);
                            if (_requestReceived != null) _requestReceived(r);
                        }
                    }
                }

                // I always like to have this in a continuous loop. Helps prevent lock-ups
                Thread.Sleep(10);
            }
        }