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
- Library usage:
:- use_module(library(pc_server)). - Exports:
- Other modules used:
- Application modules:
pc_config, pc_parser, pc_file, pc_reciever. - System library modules:
sockets/sockets, lists. - Internal (engine) modules:
term_basic, arithmetic, atomic_basic, attributes, basic_props, basiccontrol, data_facts, exceptions, io_aux, io_basic, prolog_flags, streams_basic, system_info, term_compare, term_typing, hiord_rt, debugger_support.
- Application modules:
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.