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


Purpose

This function waits 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.

Input arguments:

  • "Service" -- the HTTP service.
  • "Timeout" -- the maximum number of milliseconds to wait for a communication operation before failing. Service is set to an error state if the TCP communication times out. The timeout is only enforced after the client establishes a connection.
  • "Decode-Search-Plus" -- 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.

Output arguments:

  • "Request" -- the HTTP request object. The object values are reset to their default values before being updated by the transaction.
  • "Connection" -- the TCP connection opened between the client and the HTTP server.

Example:

  ; HttpServiceAwaitRequest

  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

Copyright © OmniMark Technologies Corporation, 1988-1998.