NVIDIA Iray API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::http::IServer Class Referenceabstract

The server builds a framework for the handlers. More...

Inheritance diagram for mi::http::IServer:
Inheritance graph
[legend]

Public Member Functions

virtual Sint32  start (const char *listen_address)=0
  Starts the server listening on the given address. More...
 
virtual void  shutdown ()=0
  Shuts down a server that has been previously started. More...
 
virtual Sint32  set_default_mime_type (const char *mime_type)=0
  Sets the default mime type to be used when no mime type was found. More...
 
virtual void  add_mime_type (const char *extension, const char *mime_type)=0
  Adds a new mime type to the server. More...
 
virtual const char *  lookup_mime_type (const char *extension)=0
  Returns the mime type registered for a certain extension. More...
 
virtual void  install (IRequest_handler *handler)=0
  Adds a new request handler to the server. More...
 
virtual void  remove (IRequest_handler *handler)=0
  Removes a previously installed request handler from the server. More...
 
virtual void  install (ICGIRequest_handler *handler)=0
  Adds a new CGI request handler to the server. More...
 
virtual void  remove (ICGIRequest_handler *handler)=0
  Removes a previously installed CGI request handler from the server. More...
 
virtual void  install (IResponse_handler *handler)=0
  Adds a new response handler to the server. More...
 
virtual void  remove (IResponse_handler *handler)=0
  Removes a previously installed response handler from the server. More...
 
virtual void  set_identification (const char *id_string)=0
  Sets the identification string of the server. More...
 
virtual const char *  get_listen_address ()=0
  Returns the listen address of the server. More...
 
virtual Size  get_nr_of_connections ()=0
  Returns the number of existing HTTP connections in this server. More...
 
virtual Size  get_nr_of_active_connections ()=0
  Returns the number of HTTP connections in this server which actually handle requests. More...
 
virtual void  set_keep_alive_timeout (Uint32 nr_of_seconds)=0
  Sets the idle timeout for keep-alive connections. More...
 
virtual Uint32  get_keep_alive_timeout () const =0
  Returns the idle timeout for keep-alive connections. More...
 
virtual void  set_send_buffer_size (Uint32 send_buffer_size)=0
  Sets the send buffer size of the socket. More...
 
virtual Uint32  get_send_buffer_size () const =0
  Returns the send buffer size of the socket. More...
 
virtual void  set_http_post_body_limit (Uint32 http_post_body_limit)=0
  Sets the size limit for the body of HTTP POST requests. More...
 
virtual Uint32  get_http_post_body_limit () const =0
  Returns the size limit for the body of HTTP POST requests. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x9923b273, 0x082f, 0x403a, 0x83, 0x57, 0xcd, 0x23, 0x9b, 0xcf, 0x68, 0x4c >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IInterface
Self
  Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
IID
  Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x9923b273, 0x082f, 0x403a, 0x83, 0x57, 0xcd, 0x23, 0x9b, 0xcf, 0x68, 0x4c >
static bool  compare_iid (const Uuid &iid)
  Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 

Detailed Description

The server builds a framework for the handlers.

Member Function Documentation

virtual void mi::http::IServer::add_mime_type ( const char *  extension,
const char *  mime_type 
)
pure virtual

Adds a new mime type to the server.

The server will use the given extension / mime_type pairs to set the content-type header in the response based on the extension of the requested URL. Note that a handler may overwrite the mime type (as any header field), if necessary.

Parameters
extension The extension identifiying the mime type.
mime_type The mime type to be set when the extension was found.
virtual Uint32 mi::http::IServer::get_http_post_body_limit ( ) const
pure virtual

Returns the size limit for the body of HTTP POST requests.

virtual Uint32 mi::http::IServer::get_keep_alive_timeout ( ) const
pure virtual

Returns the idle timeout for keep-alive connections.

virtual const char* mi::http::IServer::get_listen_address ( )
pure virtual

Returns the listen address of the server.

virtual Size mi::http::IServer::get_nr_of_active_connections ( )
pure virtual

Returns the number of HTTP connections in this server which actually handle requests.

Returns
The current number of active connections.
virtual Size mi::http::IServer::get_nr_of_connections ( )
pure virtual

Returns the number of existing HTTP connections in this server.

Returns
The current number of connections.
virtual Uint32 mi::http::IServer::get_send_buffer_size ( ) const
pure virtual

Returns the send buffer size of the socket.

virtual void mi::http::IServer::install ( IRequest_handler handler)
pure virtual

Adds a new request handler to the server.

Parameters
handler The handler to be installed.
virtual void mi::http::IServer::install ( ICGIRequest_handler handler)
pure virtual

Adds a new CGI request handler to the server.

Parameters
handler The handler to be installed.
virtual void mi::http::IServer::install ( IResponse_handler handler)
pure virtual

Adds a new response handler to the server.

Parameters
handler The handler to be installed.
virtual const char* mi::http::IServer::lookup_mime_type ( const char *  extension)
pure virtual

Returns the mime type registered for a certain extension.

Parameters
extension The file extension to lookup.
Returns
The registered mime type or NULL.
virtual void mi::http::IServer::remove ( IRequest_handler handler)
pure virtual

Removes a previously installed request handler from the server.

Parameters
handler The handler to be removed.
virtual void mi::http::IServer::remove ( ICGIRequest_handler handler)
pure virtual

Removes a previously installed CGI request handler from the server.

Parameters
handler The handler to be removed.
virtual void mi::http::IServer::remove ( IResponse_handler handler)
pure virtual

Removes a previously installed response handler from the server.

Parameters
handler The handler to be removed.
virtual Sint32 mi::http::IServer::set_default_mime_type ( const char *  mime_type)
pure virtual

Sets the default mime type to be used when no mime type was found.

Parameters
mime_type The default mime type.
Returns
0, in case of success, or -1 in case of an error.
virtual void mi::http::IServer::set_http_post_body_limit ( Uint32  http_post_body_limit)
pure virtual

Sets the size limit for the body of HTTP POST requests.

Parameters
http_post_body_limit The new size limit.
virtual void mi::http::IServer::set_identification ( const char *  id_string)
pure virtual

Sets the identification string of the server.

This string is automatically put in the "Server" header of each response. A handler might overwrite it, if necessary on a per URL basis.

Parameters
id_string The identification string.
virtual void mi::http::IServer::set_keep_alive_timeout ( Uint32  nr_of_seconds)
pure virtual

Sets the idle timeout for keep-alive connections.

The default is not to timeout.

Parameters
nr_of_seconds Seconds of idleness allowed before the server closes the connection.
virtual void mi::http::IServer::set_send_buffer_size ( Uint32  send_buffer_size)
pure virtual

Sets the send buffer size of the socket.

Increasing the buffer size can be useful in the case of high latency connections.

Parameters
send_buffer_size Size of socket send buffer.
virtual void mi::http::IServer::shutdown ( )
pure virtual

Shuts down a server that has been previously started.

The server will stop accepting new requests and shut down as fast as possible. However, requests currently being handled will be served until they are done.

See Also
start()
virtual Sint32 mi::http::IServer::start ( const char *  listen_address)
pure virtual

Starts the server listening on the given address.

The server will run within a separate thread; all requests will be handled in their own threads as well.

See Also
shutdown()
Parameters
listen_address The address to listen on.
Returns
0, if the server could be started, or -1 in case of errors.