Type Members
-
type
Receive
= PartialFunction[Any, Unit]
Value Members
-
def
!=
(arg0: AnyRef): Boolean
-
def
!=
(arg0: Any): Boolean
-
def
##
(): Int
-
def
==
(arg0: AnyRef): Boolean
-
def
==
(arg0: Any): Boolean
-
def
appendChunkExtensions
(extensions: List[ChunkExtension], sb: StringBuilder): StringBuilder
-
def
appendHeader
(name: String, value: String, sb: StringBuilder): StringBuilder
-
def
appendHeaders
(httpHeaders: List[HttpHeader], sb: StringBuilder, connectionHeaderValue: Option[String] = None): Option[String]
-
def
appendLine
(sb: StringBuilder): StringBuilder
-
def
asInstanceOf
[T0]
: T0
-
def
become
(behavior: Receive, discardOld: Boolean): Unit
-
def
cleanClose
(conn: Conn): Unit
-
def
cleanUp
(): Unit
-
def
clone
(): AnyRef
-
def
close
(conn: Conn): Unit
-
-
val
connections
: LinkedList[Conn]
-
def
dateTimeNow
: DateTime
-
def
encode
(sb: StringBuilder): ByteBuffer
-
def
eq
(arg0: AnyRef): Boolean
-
def
equals
(arg0: Any): Boolean
-
def
finalize
(): Unit
-
def
finishWrite
(conn: Conn): Unit
-
def
freshInstance
(): Option[Actor]
-
def
getClass
(): java.lang.Class[_]
-
def
handleChunkedChunk
(conn: Conn, parser: ChunkedChunkParser): Unit
-
def
handleChunkedEnd
(conn: Conn, parser: ChunkedEndParser): Unit
-
def
handleChunkedStart
(conn: Conn, parser: ChunkedStartParser): Unit
-
def
handleCompleteMessage
(conn: Conn, parser: CompleteMessageParser): Unit
-
def
handleConnectionEvent
(key: SelectionKey): Unit
-
def
handleParseError
(conn: Conn, parser: ErrorParser): Unit
-
def
handleTimedOutRequests
(): Unit
-
def
hashCode
(): Int
-
val
idleTimeoutCycle
: Option[ScheduledFuture[AnyRef]]
-
def
isDefinedAt
(message: Any): Boolean
-
def
isInstanceOf
[T0]
: Boolean
-
def
ne
(arg0: AnyRef): Boolean
-
def
notify
(): Unit
-
def
notifyAll
(): Unit
-
def
openRequestCount
: Int
-
def
optionSelf
: Option[ActorRef]
-
def
postRestart
(reason: Throwable): Unit
-
def
postStop
(): Unit
-
def
preRestart
(reason: Throwable, message: Option[Any]): Unit
-
def
preStart
(): Unit
-
def
prepareChunk
(extensions: List[ChunkExtension], body: Array[Byte]): List[ByteBuffer]
-
def
prepareChunkedResponseStart
(requestLine: RequestLine, response: HttpResponse, reqConnectionHeader: Option[String]): (List[ByteBuffer], Boolean)
-
def
prepareFinalChunk
(extensions: List[ChunkExtension], trailer: List[HttpHeader]): List[ByteBuffer]
-
def
prepareResponse
(requestLine: RequestLine, response: HttpResponse, reqConnectionHeader: Option[String]): (List[ByteBuffer], Boolean)
-
def
prepareWriting
(respond: Respond): Unit
-
def
protectIO
[A]
(operation: String, conn: Conn = null)(body: ⇒ A): Either[String, A]
-
val
readBuffer
: ByteBuffer
-
def
reapConnection
(conn: Conn): Unit
-
def
receive
: PartialFunction[Any, Unit]
-
val
requestTimeoutCycle
: Option[ScheduledFuture[AnyRef]]
-
var
requestsDispatched
: Long
-
var
requestsTimedOut
: Long
-
val
selector
: AbstractSelector
-
implicit val
self
: ScalaActorRef
-
def
serverHeader
: String
-
val
someSelf
: Some[ActorRef]
-
var
startTime
: Long
-
def
stats
: Stats
-
def
synchronized
[T0]
(arg0: ⇒ T0): T0
-
def
timeoutTimeoutResponse
(method: HttpMethod, uri: String, protocol: HttpProtocol, headers: List[HttpHeader], remoteAddress: InetAddress): HttpResponse
-
def
toString
(): String
-
def
unbecome
(): Unit
-
def
unhandled
(msg: Any): Unit
-
def
wait
(): Unit
-
def
wait
(arg0: Long, arg1: Int): Unit
-
def
wait
(arg0: Long): Unit
Deprecated Value Members
-
def
preRestart
(reason: Throwable): Unit
Inherited from ResponsePreparer
Inherited from MessagePreparer
Inherited from HttpPeer
Inherited from Actor
Inherited from AnyRef
Inherited from Any
The actor implementing the spray-can HTTP server functionality. An
HttpServer
instance starts one private thread and binds to one port (as configured with the given ServerConfig. It manages connections and requests quite efficiently and can handle thousands of concurrent connections. For every incoming HTTP request theHttpServer
creates an RequestContext instance that is dispatched to the server actor configured via the given ServerConfig.The service actor is expected to either complete the request by calling
responder.complete
or start a chunked response by callingresponder.startChunkedResponse
. If neither of this happens within the timeout period configured asrequestTimeout
in the ServerConfig theHttpServer
actor dispatches a Timeout instance to the configure timeout actor. The timeout actor is expected to complete the request within the configuredtimeoutTimeout
period. If this doesn't happen theHttpServer
completes the request itself with the result of itstimeoutTimeoutResponse
method.An
HttpServer
also reacts to cc.spray.can.GetStats messages.