TCP_OpenServer

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Modules > TcpUdp (Networking) > TCP functions >

TCP_OpenServer

 

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

 

TCP_Accept

 

Examples