Technical References - [tcpconnect]

A powerful feature to connect to a TCP port of another computer on the Internet.

[tcpconnect Parameters]TCPSend Contexts[/tcpconnect]

To embed the results of a TCP session into one of your pages, place a [tcpconnect] context into a template, and put [tcpsend] contexts inside of that. The TCPSend steps contained inside the context execute, and any returned value displays in place of the context. Any [xxx] tags inside the context are first substituted for their real values before the TCPSend executes.

TCPConnect does nothing by itself; you must insert one or more [tcpsend] contexts inside it to perform any real work. TCPConnect establishes a connection to the TCP server program and provides an environment for the TCPSend contexts to do their work and return text results.

[tcpsend]GET / HTTP/1.0[unurl]%0D%0A%0D%0A[/unurl][/tcpsend]

In this example, the http command equivalent to the URL "" executes, and the results (the home page for that site) display. Notice the use of [unurl] to send <Carriage Return><LineFeed><Carriage Return><LineFeed> as part of the TCPSend text. If you do not send the correct sequence of 2 CR/LF characters, the remote web server never returns any text, and the TCPSend times out while waiting for a response.


This example performs the equivalent of a WHOIS command which queries the Internet for information about a particular domain name. Substitute your own domain name and see what you get!

host(Required) Name or ip address of the machine to connect to. Do not insert http or ftp into the host text! TCPConnect is a very low-level connection, and it knows nothing about these protocols.
port(Optional) TCP port number to connect to. If not specified, then 80 is assumed.
ssl(Optional) Set this parameter to 'T' to create a secure socket. The port parameter should normally be set to 443 in this case.
timeoutThis new feature (from version 8.0.3) to [tcpconnect] lets you set a timeout in seconds so that if you are writing the result to a database data.db and the remote server doesn't respond in a reasonable amount of time, then the database will be released after the timeout expires. Otherwise a lock would remains held on data.db and nobody could read from the database


Top Articles:


BioType is a behavioral biometrics WebDNA function based on ADGS research and development (from version 8...

WebDNA Libraries

A list of available libraries for WebDNA...

AWS Raw WebDNA LAMP-Plus WebServer

Amazon Web Services (AWS) README for Machine Image ID...

WebDNA Modules

A list of the currently available modules...

Tips and Tricks

A list of user-submitted tips ...

Technical Change History

This Technical Change History provides a reverse chronological list of WebDNA changes...

Related Readings:




[encrypt] and [decrypt] allow you to store sensitive data in your databases without risk of exposing it to prying eyes...


Displays the method...


[thisurl] displays the URL of the current page...


Capitalizes the first letter of all words in a sentence...


Array Operation...