swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
    Other Library Functions  
function  

HttpServiceAwaitRequest

 
 

Library: HTTP support (OMHTTP)
Include: omhttp.xin

Declaration

define function HttpServiceAwaitRequest
               value       TCPService    Service
   receive     modifiable  stream        Request
   connection  modifiable  TCPConnection Connection
   timeout     value       integer       Timeout optional initial {10000}
   decode-search-plus value switch Decode-Search-Plus optional initial {false}


Argument definitions

Service
is the TCP service.
Connection
is a TCP connection object that is the connection between the server and client (output argument).
Request
is the HTTP response object containing data to send to the client (output argument).
Timeout
is the maximum number of milliseconds to wait for a communication operation before failing (input argument).
Decode-Search-Plus
is an instruction on whether to decode "+" characters to spaces in the search part of the URL. The use of "+" characters to represent spaces is not part of the HTTP standard, but is common practice in many browsers. To decode "+" characters as spaces, specify a "true" switch value for Decode-Search-Plus (input argument).


Purpose

Use HttpServiceAwaitRequest to wait on the specified TCP service until an HTTP request is received. The HTTP request object is populated from the received message and passed on to the rest of the program for processing to create an HTTP response object. HttpServiceAwaitRequest occurs in a server program.

Requirements

You must include the following line at the beginning of your OmniMark program:

  include "omhttp.xin"

Usage Notes

Service is set to an error state if the TCP communication times out. The timeout is only enforced after the client establishes a connection.

Connection is set to an error state if the TCP communication times out.

Example


  ; HttpServiceAwaitRequest
  include "omhttp.xin"
  
  process
  
     local TCPService my-Service
     local TCPConnection client-Connection
     local HttpRequest new-Request
  
     set my-Service to TCPServiceOpen at 1080
  
     HttpServiceAwaitRequest
        my-Service receive new-Request connection client-Connection timeout 30000

      Other Library Functions
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:38:10 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.