Lasso Soft Inc. > Home

[TCP_Send]

[TCP_Send] sends a string through a low-level TCP/IP connection to a remote server and returns the results.

This tag requires a -Name parameter which is the local name of a TCP/IP connection that was opened using a [TCP_Open] tag.

Any string values included in the tag are concatenated together and sent as a message to the remote server. The responses from each remote server are collected into a buffer and then returned from the [TCP_Send] tag.

If the -DontWait parameter is set to True then the tag will return no result. However, any response from the remote server will still be collected into the buffer and will be returned by the next [TCP_Send] tag that returns a result.

If the -StopAfter parameter is specified then the contents of the buffer for the current connection will be returned up until the specified value. This allows the incoming buffer to be parsed out in chunks. Note: [TCP_Send] can be called with a -StopAfter, but no string value to send, in order to simply receive data from the remote server.

The optional -TimeOut parameter specifies how many seconds Lasso should wait before giving up on a response from the remote server. After timing out any data from the server that is in the buffer will be returned.

  • Syntax
  • Parameters
[TCP_Send: -Name='Connection Name', 
 String Value]

[TCP_Send: -Name='Connection Name',
  -DontWait=True,
  String Value]

[TCP_Send: -Name='Connection Name',
  -StopAfter='Stop Characters',
  String Value]

[TCP_Send: -Name='Connection Name',
  -StopAfter='Stop Characters']

[TCP_Send: -Name='Connection Name',
 -TimeOut=TimeOut Seconds,
  String Value]
Required Parameters
String Value The value to send through the TCP connection.
-Name The name of the TCP connection to send through.
Optional Parameters
-StopAfter An optional delimiter. If specified the results of the TCP connection will be read until this string is encountered.
-Timeout The number of seconds to wait before timing out the TCP connection.
-DontWait If set to True then no results will be returned from the tag. Defaults to False.
Examples

To send a command through a low-level TCP/IP connection to a remote server:

Use the [TCP_Send] tag. The following example sends a GET request to a Web server through a connection named Example. All of the results of the GET are returned.

[TCP_Send: -Name='Example',
  -TimeOut=30,
  'GET / HTTP/1.0 ']
Result:
<html>
  <head>
    <title> Example Web Page </title>
  </head>
  <body>
    ...
  </body>
</html>
Tag Link [TCP_Send] Category Technical
Type Substitution Data Source Any
Support Preferred Version 5.0
Output Type String Security Tag
Implementation Sets Lasso 5.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. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft