Connects to any host on the Internet or intranet. sHost can be the domain name or the IP address. You can also use the predefined host name standardhost, which can be set in the Workbench. A URL cannot be used with WebTcpipConnect. This function must be used before any other call to WebTcpip functions.
WebAPI.bdh
WebTcpipConnect( out hWeb : number, in sHost : string, in nPort : number, in nSecurity : number optional, in sLocalAddress : string optional ): boolean;
true if the function succeeds, and the function stores a valid handle in hWeb
false otherwise
Parameter | Description |
---|---|
hWeb |
Variable receiving a handle to the Web connection. If this parameter contains a handle to a Web connection prior to the WebTcpipConnect function call, the memory allocated with the handle is released. Whenever you want to create a new Web connection, make sure this variable is initialized with 0 (this is automatically done within transactions when they are executed for the first time, but not within functions) |
sHost | Domain name or IP address, for example, "hostname.com" or "192.231.34.1" |
nPort |
Port to connect to. The following constants can be used as the standard port:
|
nSecurity |
Specifies whether to establish a secure connection to the remote server (optional). Possible options are:
|
sLocalAddress | Specifies the local address and the port to which the socket should be bound (optional), for example, "192.168.70.101:4000". |
dcltrans transaction TWebApplevel var hWeb: number; begin WebTcpipConnect(hWeb, "standardhost", WEB_PORT_HTTP); WebTcpipShutdown(hWeb); end TWebApplevel;
WebFileUpload01.bdf, WebMulti01.bdf, WebSecure01.bdf, WebTcpipHttp01.bdf, WebTcpipWebStone01.bdf