wcConOpen( )

Syntax . . Returns . . Tips . . Program Example . . Related Topics . . A-Z Index . . Home

Sets up the time out, then blocks, waiting for user request. It then reads the QUERY_STRING and PATH_INFO and any form data and saves them as variables.

Example

returnCode = wcConOpen(cntrlHandle, 3600);

Syntax

int wcConOpen(void *controlHandle, 
              int timeout)
controlHandleThe handle to the control structure.
timeoutThe number of seconds to wait for the browser to reconnect to the application. Use this parameter to set a different timeout value for each HTML page in an application. Each time the user receives an HTML page from the application, wcConOpen( ) is executed and you can pass in a new timeout value. If this parameter is 0, the function uses the MI_WEBTIMEOUT value from the configuration file.

Returns

0Success.
Error codeFailure or exception. The message ERR_MSGSHUTDOWN is returned when the Web browser session has timed out. This message notifies the application so it can perform cleanup tasks and exit. If the application does not cleanup and exit in response to this error message, INFORMIX-Universal Web Connect will terminate the application process automatically with no cleanup. For a list of other possible error codes, see Error Messages.

Tips

Program Example

The following code shows how wcConOpen( ) is used in an application.

int requestLoop(wcp)
	void	*wcp;
{
	int	ret;

	/* set defaults */
	wcSetVariable(wcp, "MItab", "webPages");
	wcSetVariable(wcp, "MIcol", "object");
	wcSetVariable(wcp, "MInam", "ID");
	wcSetVariable(wcp, "MIval", "main");

	while(1)
	{
		if((ret = wcConOpen(wcp, 0)) < 0)
			return wcTraceErr(wcp, ret);

		handleRequest(wcp);

		if((ret = wcConClose(wcp)) < 0)
			return wcTraceErr(wcp, ret);
	}
}

In this code fragment, it is assumed that the function handleRequest( ) has been declared to return an HTML page to the browser.

Related Topics

wcConClose( )
Configuration File Parameters


Top of Page . . Syntax . . Returns . . Tips . . Program Example . . A-Z Index . . Home