Server

Author(s): Christian Giménez.

With this you can load all necessary libraries and start de server.

Before trying to start, take a look at the file pc_config, and change whatever you need.

Starting

For starting the server use the predicate start_server/0 at the Ciao terminal after loading this module.


Usage and interface

Documentation on exports

PREDICATE

Usage:

  • Description: Start the server using information from pc_config module. This is true if starting the server and parsing information was performed accordingly.

PREDICATE

Usage: open_port(-Socket)

  • Description: Is t iff Socket can be instantiated with the socket corresponding to the port given by pc_config.

PREDICATE

Usage: accept_next_client(+Socket)

  • Description: Given a Socket it becames true if retrieving and parsing is fine.

PREDICATE

Usage: process_client(+Stream)

  • Description: Is t iff a request is recieved, parsed and answered as expected.

PREDICATE

Usage: send_info(+Stream,+Head,+File)

  • Description: Is true if the File is opened and its content sended throught the given Stream. Head is the HTTP status of the request(200, 404, etc.).

PREDICATE

Usage: take_head(+PageExists,-Head)

  • Description: t iff Head is unified with the correct HTTP header according if PageExists. PageExists must be true or false, telling if the page requested by the client exists locally.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.