[Net_ConnectInProgress] represents a return value from the [Net->Connect] tag. This value is returned when a connect is attempted, but the [Net] object already has an open connection.
<?LassoScript
Variable: 'Connection' = (Net);
If: $Net->(Connect: 'www.example.com', '80') == Net_ConnectInProgress;
Output: 'A connection is already in progress.';
/If;
?>
Use the [Net] type and its member tags to establish a TCP connection. The following example opens a blocking TCP connection to the Web server running on an example server and fetches the root document. The result will be an HTML page.
[Variable: 'myConnection' = (Net)]
[$myConnection->(SetBlocking: True)]
[$myConnection->(SetType: Net_TypeTCP)]
[Var: 'Result' = $myConnection->(Connect: 'www.example.com', 80)]
[Fail_If: $Result == Net_ConnectInProgress, (-1), 'TCP Error']
[Variable: 'Result' = $myConnection->(Write: 'GET /\r\n')]
[Variable: 'Output' = $myConnection->(Read: 32768)]
[$myConnection->(Close)]
[Output: $Output]
<html><head><title>HTML Document</title></head>>body> ...
Tag Link | [Net_ConnectInProgress] | Category | Networking |
---|---|---|---|
Type | Constant | Data Source | Any |
Support | Preferred | Version | 7.0 |
Output Type | Integer | Security | None |
Implementation | LCAPI | Sets | Lasso 8.5, Lasso 8.0, Lasso 7.0 |
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft