# 22. Virtuoso Functions Guide - http_listen_host

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
Virtuoso Functions Guide
Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
dav add & update fun...
dav manipulation fun...
dav search functions
dav_exp
lfs_exp
serv_queue_top
vhost_define
vhost_remove
webdav users & group...
client_attr
connection_get
connection_id
connection_is_dirty
connection_set
connection_vars
connection_vars_set
dbname
ftp_get
ftp_ls
ftp_put
get_certificate_info
get_keyword
get_keyword_ucase
http
http_acl_get
http_body_read
http_client
http_client_ip
http_debug_log
http_enable_gz
http_file
http_flush
http_get
http_header
http_header_get
http_kill
http_listen_host
http_map_get
http_map_table
http_param
http_path
http_pending_req
http_physical_path
http_proxy
http_request_get
http_request_header
http_request_status
http_rewrite
http_root
http_url
http_value
http_xslt
ses_connect
ses_disconnect
ses_read_line
ses_write
tcpip_gethostbyaddr
tcpip_gethostbyname
vsp_calculate_digest
wsdl_import_udt
XML
XPATH & XQUERY
Functions Index

## http_listen_host

Starts, stops and retrieves the state of a user-defined HTTP listener
integer http_listen_host (in interface_address varchar, in action integer, [in options vector]);
Description

This function requires dba privileges.

This function is used to start, stop or lookup the state of user-defined HTTP and HTTPS listeners. The return value is 0 or 1 and indicates state of the listener, 1 for started and 0 for stopped.

Parameters
interface_address – IP address of interface to be started, stopped or queried for its current state.
action – Can only take one of the following integer values:

- 0 - start
- 1 - stop
- 2 - query state

options – An array of name-value pairs for setting up a HTTPS listeners. This parameter only used for starting HTTPS listeners, and nothing more. The available options are:

- https_cv - certificate authority file for verification.
- https_cert - server certificate.
- https_key server private key.
- https_cv_depth - depth of chain for CA verification.

The certificate and key are mandatory for HTTPS listeners, but the others are optional. They are similar to the SSLCertificate, SSLPrivateKey, X509ClientVerifyCAFile, X509ClientVerifyDepth Virtuoso INI file settings.
Return Types

The return type is integer, and will be either 0 or 1 to indicate the state of the listener, 1 for started and 0 for stopped.

Examples
Starting/stopping and state retrival of a listener

      SQL> http_listen_host ('127.0.0.1:7780', 0);
      SQL> select http_listen_host ('127.0.0.1:7780', 2);
      callret
      VARCHAR
      _______________________________________________________________________________

      1

      1 Rows. -- 1 msec.

      SQL> http_listen_host ('127.0.0.1:7780', 1);
      SQL> select http_listen_host ('127.0.0.1:7780', 2);
      callret
      VARCHAR
      _______________________________________________________________________________

      0

      1 Rows. -- 1 msec.