Servo.HttpServer (Tom Servo v0.1.0) View Source

Link to this section Summary

Functions

Accepts client connections on the listen_socket.

Returns a generic HTTP response. For testing only

Receives a request on the client_socket.

Receives the request on the client_socket and sends a response back over the same socket.

Starts the server on the given port of localhost. (Ports 0-1023 are reserved for OS)

Sends response over the client_socket.

Link to this section Functions

Link to this function

accept_loop(listen_socket)

View Source

Accepts client connections on the listen_socket.

Link to this function

generate_response(request)

View Source

Returns a generic HTTP response. For testing only

Link to this function

read_request(client_socket)

View Source

Receives a request on the client_socket.

Receives the request on the client_socket and sends a response back over the same socket.

Starts the server on the given port of localhost. (Ports 0-1023 are reserved for OS)

Link to this function

write_response(response, client_socket)

View Source

Sends response over the client_socket.