This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.
This version is copyright and may only be used for local testing purposes. It may not be distributed.
Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.
Description
Open a TCP/IP port or service name for communication as a server.
Syntax
n = TCP_OpenServer(sPortOrServiceName, sHost, nFile [, nTimeOut])
Returns
Error code, if any.
Parameters
Name |
Type |
Optional |
Meaning |
sPortOrServiceName |
Any |
No |
This parameter can be either a port number or a service name. thinBasic will take care of it. For example to open a connection with a web server, either specify 80 or "HTTP". To open a connection with a SMTP server, either specify 25 or "SMTP" |
sHost |
String |
No |
IP number or server name |
nFile |
Number |
No |
File number. Use an unused file number. To get the first available file number, use TCP_FreeFile function |
nTimeOut |
Number |
Yes |
Time out in milliseconds. If no timeout, a standard 60 000 milliseconds (60 seconds) will be used |
Remarks
Restrictions
See also
Examples