             return try Response(pathToFile: path)
         })
     }
+}
+
+// MARK: - RunStatus
+public extension Server {
+    public enum RunStatus {
+        case willRun
+        case running
+        case paused
+        case pausing(now: Bool, closure: ()->())
+        case stopped
+        case stopping(now: Bool)
+    }
+
+    var isPaused: Bool {
+        guard case .stopped = runStatus else {
+            return false
+        }
+        return true
+    }
+
+    var willRun: Bool {
+        guard case .willRun = runStatus else {
+            return false
+        }
+        return true
+    }
+
+    var isStopped: Bool {
+        guard case .stopped = runStatus else {
+            return false
+        }
+        return true
+    }
+
+    var isRunning: Bool {
+        guard case .running = runStatus else {
+            return false
+        }
+        return true
+    }
+}
+
+// MARK: - Sending
+private extension Server {
+
 
     private func sendPartial(socket: Socket, range: (bottom: UInt, top: UInt), response: Response) {
         let bodyBytes = response.rawBody

        } catch let error {
            log.error("error with client: \(error)")
        }
        connected.removeValue(forKey: socket.socketfd)
        socket.close()
    }

    private func handle(request: Request) -> Response {

        }

        let body: Data
        //        if response.contentEncoding == .gzip {
        //            body = response.gzippedBody
        //            response.headers.set(to: .contentEncoding(.gzip))
        //        } else {
        body = response.rawBody
        //        }
        response.headers.set(to: .contentLength(size: body.count))
        let head = response.rawHeader
        let _ = try? socket.write(from: head + body)
