A powerful feature to connect to a TCP port of another computer on the Internet.
numero = 264[tcpconnect host=www.webdna.us&port=80][tcpsend]GET / HTTP/1.0[unurl]%0D%0A%0D%0A[/unurl][/tcpsend][/tcpconnect]In this example, the http command equivalent to the URL "http://www.webdna.us" 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.
[tcpconnect host=internic.net&port=43][tcpsend]webdna.us[unurl]%0D%0A%0D%0A[/unurl][/tcpsend][/tcpconnect]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!
| Parameter | Description |
|---|---|
| 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. |
| timeout | This 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 |
[tcpconnect host=www.webdna.us&port=80]
[tcpsend]GET / HTTP/1.0[unurl]%0D%0A%0D%0A[/unurl][/tcpsend]
[/tcpconnect]
[tcpconnect host=internic.net&port=43]
[tcpsend]webdna.us[unurl]%0D%0A%0D%0A[/unurl][/tcpsend]
[/tcpconnect]
| Parameter | Description |
|---|---|
| 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. |
| timeout | This 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 |
DOWNLOAD WEBDNA NOW!
WebDNA applications...
WebDNA reference...
F.A.QA compilation of some user's questions...
WebDNA ModulesA list of the currently available modules...
Tips and TricksA list of user-submitted tips ...
Technical Change HistoryThis Technical Change History provides a reverse chronological list of WebDNA changes...
[append db=base...
[cookie]Cookies are a great way to remember visitors...
[if]This context displays HTML or executes WebDNA conditionally only if the expression is true...
[hide]Prevents WebDNA to return hidden parts of your code to apache (from version 8...
[commitdatabase][COMMITDATABASE db=name...
[validcard]Checks legitimacy of credit card...