swirl Guide to OmniMark 6   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesOMX VariablesErrors
 
      Other Library Functions  
function   HttpServiceAwaitRequest   Available in:
Enterprise
Professional

Library: omhttp - HTTP support
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}
  where
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
   HttpConnectionSendResponse
   HttpLibraryVersion
   HttpObjectGetCookieAttributes
   HttpObjectGetCookieValues
   HttpObjectGetHeaders
   HttpObjectGetStatusReport
   HttpObjectIsInError
   HttpObjectSetCookieAttribute
   HttpObjectSetCookieValue
   HttpObjectSetHeader
   HttpRequest
   HttpRequestGetSearchItems
   HttpRequestSend
   HttpRequestSetFromUrl
   HttpRequestSetProxy
   HttpRequestSetSearchItem
   HttpResponse
   HttpResponseOutput
   HttpServiceAwaitRequest
 
----  

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

OmniMark 6.5 Documentation Generated: December 23, 2002 at 6:25:23 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © OmniMark Technologies Corporation, 1988-2002.