object
http_server
User-facing HTTP(S) server facade built on top of the HTTP transport libraries.
logtalk_load(http_server(loader))static, context_switching_calls, threadedPublic predicates
open/3
Opens a listener on the loopback address using the selected scheme and transport options and returns an opaque server handle.
staticopen(Port,Server,Options)open(+integer,--compound,+list) - one_or_errorOptions is a variable:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is a variable:instantiation_errorOption of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)existence_error(object,Transport)domain_error(http_transport_protocol_object,Transport)Options selects incompatible scheme and transport values:consistency_error(http_server_options,scheme(Scheme),transport(Transport))Options selects incompatible scheme and listener transport values:consistency_error(http_server_options,scheme(Scheme),listener_transport(ListenerTransport))Port is not a non-negative integer or a variable accepted by the selected transport:domain_error(non_negative_integer,Port)Options contains listener options rejected by the selected transport:domain_error(option,Option)resource_error(http_process_transport_listener)open/4
Opens a listener on the given host using the selected scheme and transport options and returns an opaque server handle.
staticopen(Host,Port,Server,Options)open(+atom,+integer,--compound,+list) - one_or_errorHost is not a valid listener host atom for the selected transport:type_error(atom,Host)Port is not a non-negative integer or a variable accepted by the selected transport:domain_error(non_negative_integer,Port)Options is a variable:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is a variable:instantiation_errorOption of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)existence_error(object,Transport)domain_error(http_transport_protocol_object,Transport)Options selects incompatible scheme and transport values:consistency_error(http_server_options,scheme(Scheme),transport(Transport))Options selects incompatible scheme and listener transport values:consistency_error(http_server_options,scheme(Scheme),listener_transport(ListenerTransport))Options contains listener options rejected by the selected transport:domain_error(option,Option)resource_error(http_process_transport_listener)close/1
Closes an open server listener.
staticclose(Server)close(+compound) - one_or_errorServer is a variable:instantiation_errorServer is not an open HTTP server handle:domain_error(http_server,Server)Server refers to a listener rejected by the selected transport:domain_error(http_socket_transport_listener,Listener)Server refers to a listener that no longer exists for the selected transport:existence_error(http_socket_transport_listener,Listener)request_listener_shutdown/1
Requests shutdown of a blocking accept operation on an open server listener.
staticrequest_listener_shutdown(Server)request_listener_shutdown(+compound) - one_or_errorServer is a variable:instantiation_errorServer is not an HTTP server handle:domain_error(http_server,Server)Server refers to a listener rejected by the selected transport:domain_error(http_socket_transport_listener,Listener)Server refers to a listener that no longer exists for the selected transport:existence_error(http_socket_transport_listener,Listener)serve_once/3
Serves a single request on an open server listener.
staticserve_once(Server,Handler,ClientInfo)serve_once(+compound,+object_identifier,--compound) - one_or_errorServer is a variable:instantiation_errorServer is not an open HTTP server handle:domain_error(http_server,Server)Handler does not conform to the HTTP handler protocol:domain_error(http_handler_protocol,Handler)domain_error(http_response_stream,Error)serve_websocket_once/5
Serves a single WebSocket opening handshake on an open server listener.
staticserve_websocket_once(Server,Handler,Connection,Response,ClientInfo)serve_websocket_once(+compound,+object_identifier,--compound,--compound,--compound) - one_or_errorServer is a variable:instantiation_errorServer is not an open HTTP server handle:domain_error(http_server,Server)Handler does not conform to the HTTP handler protocol:domain_error(http_handler_protocol,Handler)existence_error(http_socket_transport_websocket_request,end_of_file)domain_error(http_socket_transport_websocket_response,Response)domain_error(http_response_stream,Error)serve/4
Serves a bounded number of requests on an open server, or opens a loopback listener, serves requests, and closes it.
staticserve(ServerOrPort,Handler,Count,ClientInfosOrOptions)serve(+compound,+object_identifier,+integer,--list) - one_or_errorserve(+integer,+object_identifier,+integer,+list) - one_or_errorServerOrPort is a variable:instantiation_errorServerOrPort is neither a variable nor a compound or integer:type_error(atom_or_compound,ServerOrPort)ServerOrPort is a compound term but not an open HTTP server handle:domain_error(http_server,ServerOrPort)Count is a variable:instantiation_errorCount is not a non-negative integer:domain_error(non_negative_integer,Count)ClientInfosOrOptions is a variable when opening a listener from a port:instantiation_errorClientInfosOrOptions is neither a variable nor a list when opening a listener from a port:type_error(list,Options)Option of the list ClientInfosOrOptions is a variable when opening a listener from a port:instantiation_errorOption of the list ClientInfosOrOptions is neither a variable nor a compound term when opening a listener from a port:type_error(compound,Option)Option of the list ClientInfosOrOptions is a compound term but not a valid option when opening a listener from a port:domain_error(option,Option)Handler does not conform to the HTTP handler protocol:domain_error(http_handler_protocol,Handler)existence_error(object,Transport)domain_error(http_transport_protocol_object,Transport)ClientInfosOrOptions selects incompatible scheme and transport values when opening a listener from a port:consistency_error(http_server_options,scheme(Scheme),transport(Transport))ClientInfosOrOptions selects incompatible scheme and listener transport values when opening a listener from a port:consistency_error(http_server_options,scheme(Scheme),listener_transport(ListenerTransport))domain_error(http_response_stream,Error)resource_error(threads)serve/5
Serves a bounded number of requests on an open server, or opens a loopback listener, serves requests, and closes it.
staticserve(ServerOrPort,Handler,Count,ClientInfos,Options)serve(+compound,+object_identifier,+integer,--list,+list) - one_or_errorserve(+integer,+object_identifier,+integer,--list,+list) - one_or_errorServerOrPort is a variable:instantiation_errorServerOrPort is neither a variable nor a compound or integer:type_error(atom_or_compound,ServerOrPort)ServerOrPort is a compound term but not an open HTTP server handle:domain_error(http_server,ServerOrPort)Count is a variable:instantiation_errorCount is not a non-negative integer:domain_error(non_negative_integer,Count)Options is a variable:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is a variable:instantiation_errorOption of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)Options contains an option that is not valid for serving on an already open server:domain_error(http_server_serve_option,Option)Handler does not conform to the HTTP handler protocol:domain_error(http_handler_protocol,Handler)existence_error(object,Transport)domain_error(http_transport_protocol_object,Transport)Options selects incompatible scheme and transport values when opening a listener from a port:consistency_error(http_server_options,scheme(Scheme),transport(Transport))Options selects incompatible scheme and listener transport values when opening a listener from a port:consistency_error(http_server_options,scheme(Scheme),listener_transport(ListenerTransport))Options contains listener-serving options rejected by the selected transport:domain_error(http_socket_transport_listener_option,Option)domain_error(http_response_stream,Error)resource_error(threads)serve/6
Opens a listener on the given host, serves a bounded number of requests, and closes it.
staticserve(Host,Port,Handler,Count,ClientInfos,Options)serve(+atom,+integer,+object_identifier,+integer,--list,+list) - one_or_errorHost is not a valid listener host atom for the selected transport:type_error(atom,Host)Port is not a non-negative integer or a variable accepted by the selected transport:domain_error(non_negative_integer,Port)Count is a variable:instantiation_errorCount is not a non-negative integer:domain_error(non_negative_integer,Count)Options is a variable:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is a variable:instantiation_errorOption of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)existence_error(object,Transport)domain_error(http_transport_protocol_object,Transport)Options selects incompatible scheme and transport values:consistency_error(http_server_options,scheme(Scheme),transport(Transport))Options selects incompatible scheme and listener transport values:consistency_error(http_server_options,scheme(Scheme),listener_transport(ListenerTransport))Options contains listener-serving options rejected by the selected transport:domain_error(http_socket_transport_listener_option,Option)Handler does not conform to the HTTP handler protocol:domain_error(http_handler_protocol,Handler)domain_error(http_response_stream,Error)resource_error(threads)resource_error(http_process_transport_listener)serve_until_shutdown/5
Opens a listener on the given host and serves requests until shutdown is requested.
staticserve_until_shutdown(Host,Port,Handler,Control,Options)serve_until_shutdown(+atom,+integer,+object_identifier,+nonvar,+list) - one_or_errorHost is not a valid listener host atom for the selected transport:type_error(atom,Host)Port is not a non-negative integer or a variable accepted by the selected transport:domain_error(non_negative_integer,Port)Control is a variable:instantiation_errorControl is already registered for another open-ended server loop:permission_error(open,http_server_shutdown_control,Control)Options is a variable:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is a variable:instantiation_errorOption of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)existence_error(object,Transport)domain_error(http_transport_protocol_object,Transport)Options selects incompatible scheme and transport values:consistency_error(http_server_options,scheme(Scheme),transport(Transport))Options selects incompatible scheme and listener transport values:consistency_error(http_server_options,scheme(Scheme),listener_transport(ListenerTransport))Options contains listener-serving options rejected by the selected transport:domain_error(http_socket_transport_listener_option,Option)Handler does not conform to the HTTP handler protocol:domain_error(http_handler_protocol,Handler)domain_error(http_response_stream,Error)resource_error(threads)resource_error(http_process_transport_listener)serve_until_shutdown/6
Opens a listener on the given host, calls Ready after shutdown control registration, and serves requests until shutdown is requested.
staticserve_until_shutdown(Host,Port,Handler,Control,Options,Ready)serve_until_shutdown(*,*,*,*,*,0)serve_until_shutdown(+atom,+integer,+object_identifier,+nonvar,+list,+callable) - one_or_errorHost is not a valid listener host atom for the selected transport:type_error(atom,Host)Port is not a non-negative integer or a variable accepted by the selected transport:domain_error(non_negative_integer,Port)Control is a variable:instantiation_errorControl is already registered for another open-ended server loop:permission_error(open,http_server_shutdown_control,Control)Options is a variable:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is a variable:instantiation_errorOption of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)existence_error(object,Transport)domain_error(http_transport_protocol_object,Transport)Options selects incompatible scheme and transport values:consistency_error(http_server_options,scheme(Scheme),transport(Transport))Options selects incompatible scheme and listener transport values:consistency_error(http_server_options,scheme(Scheme),listener_transport(ListenerTransport))Options contains listener-serving options rejected by the selected transport:domain_error(http_socket_transport_listener_option,Option)Handler does not conform to the HTTP handler protocol:domain_error(http_handler_protocol,Handler)domain_error(http_response_stream,Error)resource_error(threads)resource_error(http_process_transport_listener)request_shutdown/1
Requests shutdown of an open-ended server loop.
staticrequest_shutdown(Control)request_shutdown(+nonvar) - one_or_errorControl is a variable:instantiation_errorControl is not registered for an open-ended server loop:existence_error(http_server_shutdown_control,Control)resource_error(threads)server_property/2
Enumerates selected properties of a server handle.
staticserver_property(Server,Property)server_property(+compound,?compound) - zero_or_morestart/4
Starts an open-ended loopback server in a worker thread and waits until it is ready to accept requests. Throws a resource error when thread support is not available.
staticstart(Port,Handler,Server,Options)start(+integer,+object_identifier,--compound,+list) - one_or_errorPort is not a non-negative integer or a variable accepted by the selected transport:domain_error(non_negative_integer,Port)Options specifies a variable shutdown control:instantiation_errorOptions is a variable:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is a variable:instantiation_errorOption of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)existence_error(object,Transport)domain_error(http_transport_protocol_object,Transport)Options selects incompatible scheme and transport values:consistency_error(http_server_options,scheme(Scheme),transport(Transport))Options selects incompatible scheme and listener transport values:consistency_error(http_server_options,scheme(Scheme),listener_transport(ListenerTransport))Options contains listener-serving options rejected by the selected transport:domain_error(http_socket_transport_listener_option,Option)Handler does not conform to the HTTP handler protocol:domain_error(http_handler_protocol,Handler)domain_error(http_response_stream,Error)resource_error(http_process_transport_listener)resource_error(threads)start/5
Starts an open-ended server in a worker thread and waits until it is ready to accept requests. Throws a resource error when thread support is not available.
staticstart(Host,Port,Handler,Server,Options)start(+atom,+integer,+object_identifier,--compound,+list) - one_or_errorHost is not a valid listener host atom for the selected transport:type_error(atom,Host)Port is not a non-negative integer or a variable accepted by the selected transport:domain_error(non_negative_integer,Port)Options specifies a variable shutdown control:instantiation_errorOptions is a variable:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is a variable:instantiation_errorOption of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)existence_error(object,Transport)domain_error(http_transport_protocol_object,Transport)Options selects incompatible scheme and transport values:consistency_error(http_server_options,scheme(Scheme),transport(Transport))Options selects incompatible scheme and listener transport values:consistency_error(http_server_options,scheme(Scheme),listener_transport(ListenerTransport))Options contains listener-serving options rejected by the selected transport:domain_error(http_socket_transport_listener_option,Option)Handler does not conform to the HTTP handler protocol:domain_error(http_handler_protocol,Handler)domain_error(http_response_stream,Error)resource_error(http_process_transport_listener)resource_error(threads)stop/1
Requests shutdown of a threaded server and waits for the worker thread to finish. Throws a resource error when thread support is not available.
staticstop(Server)stop(+compound) - one_or_errorServer is a variable:instantiation_errorServer is not a threaded HTTP server handle:domain_error(http_server,Server)resource_error(threads)Protected predicates
(no local declarations; see entity ancestors if any)
Private predicates
server_control_/3
Table of HTTP server shutdown control handles.
dynamicserver_control_(Control,Transport,Server)server_control_(?nonvar,?object_identiifer,?compound) - zero_or_moreserver_control_counter_/1
Counter for generating unique HTTP server shutdown control identifiers.
dynamicserver_control_counter_(Counter)server_control_counter_(-integer) - zero_or_oneOperators
(none)