         return result
     }
     
-    /// Write data to the socket
-    ///
-    /// - Parameter data: An NSData object containing the bytes to be written to the socket.
+    /**
+     Write data to the socket
+     
+     - Parameter data: An NSData object containing the bytes to be written to the socket.
+     
+     ### Usage Example: ###
+     ````swift
+     processor.write(from: buffer)
+     ````
+     */
     public func write(from data: NSData) {
         handler?.write(from: data)
     }
     
-    /// Write a sequence of bytes in an array to the socket
-    ///
-    /// - Parameter from: An UnsafeRawPointer to the sequence of bytes to be written to the socket.
-    /// - Parameter length: The number of bytes to write to the socket.
+    /**
+     Write a sequence of bytes in an array to the socket
+     
+     - Parameter from: An UnsafeRawPointer to the sequence of bytes to be written to the socket.
+     - Parameter length: The number of bytes to write to the socket.
+     
+     ### Usage Example: ###
+     ````swift
+     processor.write(from: utf8, length: utf8Length)
+     ````
+     */
     public func write(from bytes: UnsafeRawPointer, length: Int) {
         handler?.write(from: bytes, length: length)
     }
     
-    /// Close the socket and mark this handler as no longer in progress.
+    /**
+     Close the socket and mark this handler as no longer in progress.
+     
+     ### Usage Example: ###
+     ````swift
+     processor?.close()
+     ````
+     */
     public func close() {
         keepAliveUntil=0.0
         inProgress = false

import LoggerAPI
import Socket

/// This class processes the data sent by the client after the data was read. The data
/// is parsed, filling in a `HTTPServerRequest` object. When the parsing is complete, the
/// `ServerDelegate` is invoked.
public class IncomingHTTPSocketProcessor: IncomingSocketProcessor {
    
    /// A back reference to the `IncomingSocketHandler` processing the socket that
    /// this `IncomingDataProcessor` is processing.
    public weak var handler: IncomingSocketHandler?
        
    private weak var delegate: ServerDelegate?
    
    /// Keep alive timeout for idle sockets in seconds
    static let keepAliveTimeout: TimeInterval = 60
    
    /// A flag indicating that the client has requested that the socket be kept alive
    private(set) var clientRequestedKeepAlive = false
    
    /// The socket if idle will be kep alive until...
    public var keepAliveUntil: TimeInterval = 0.0
    
    /// A flag indicating that the client has requested that the prtocol be upgraded
    private(set) var isUpgrade = false
    
    /// A flag that indicates that there is a request in progress
    public var inProgress = true
    
    ///HTTP Parser

        self.keepAliveState = keepalive
    }
    
    /**
     Process data read from the socket. It is either passed to the HTTP parser or
     it is saved in the Pseudo synchronous reader to be read later on.
     
     - Parameter buffer: An NSData object that contains the data read from the socket.
     
     - Returns: true if the data was processed, false if it needs to be processed later.
     
     ### Usage Example: ###
     ````swift
     let processed = processor.process(readBuffer)
     ````
     */
    public func process(_ buffer: NSData) -> Bool {
        let result: Bool
        
