An HTTP Session is the external API to the communication link between client and server. A session can only transfer one message at a time in each direction. The client and server each have their own ways of implementing this interface, but to application code (either in the client or in the server 'back end') this interface provides a common view of how information is passed into the net/http package.

interface tag HTTPSession

Public Behaviours


Start sending a request or response. The Payload must have all its essential fields filled in at this point, because ownership is being transferred to the session actor. This begins an outbound message.

be apply(
  payload: Payload val)



Indicate that all outbound add_chunk calls have been made and submission of the HTTP message is complete.

be finish()


Close the connection from this end.

be dispose()


Write raw byte stream to the outbound TCP connection.

be write(
  data: (String val | Array[U8 val] val))



Tell the session to stop sending an outbound message.

be cancel(
  msg: Payload val)


Private Behaviours


Stop delivering incoming data to the handler. This may not be effective instantly.

be _mute()


Resume delivering incoming data to the handler.

be _unmute()


The appropriate Payload Builder will call this from the TCPConnection actor to start delivery of a new inbound message. If the Payloads transfer_mode is OneshotTransfer, this is the only notification that will happen for the message. Otherwise there will be one or more _chunk calls followed by a _finish call.

be _deliver(
  payload: Payload val)



Deliver a piece of inbound body data to the application HTTPHandler This is called by the PayloadBuilder.

be _chunk(
  data: (String val | Array[U8 val] val))



Inidcates that the last inbound body chunk has been sent to _chunk. This is called by the PayloadBuilder.

be _finish()