Difference between revisions of "MC-Basic:CONNECT"

From SoftMC-Wiki
Jump to: navigation, search
m (1 revision)
(Added timeout)
 
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
{{Languages|MC-Basic:CONNECT}}
 
{{MC-Basic
 
{{MC-Basic
 
|SHORT FORM=
 
|SHORT FORM=
Line 4: Line 5:
  
 
|SYNTAX=
 
|SYNTAX=
Connect(#<''device number''>, <''ip address''>,<''port number''>)
+
Connect(#<''device number''>, <''ip address''>,<''port number''>{,<''port number''>})
  
 
|AVAILABILITY=
 
|AVAILABILITY=
Line 10: Line 11:
  
 
|DESCRIPTION=
 
|DESCRIPTION=
Request a TCP connection from the remote host.
+
Requests a TCP connection from the remote host.
  
Function               Request TCP connection from remote host
 
  
 
|TYPE=
 
|TYPE=
<''device number''> : Long<br>
+
<''device number''>: Long<br>
 
+
<''port number''>: Long<br>
<''port number''> : Long
+
<''ip address''>: string<br>
 
+
<''timeout''>: Long<br>
<''ip address''> : string
 
  
  
  
 
|RANGE=
 
|RANGE=
<''device number''> :   1 to 255
+
<''device number''>: 1 to 255
  
<''ip address''> = IP address<br>
+
<''ip address''>: IP address<br>
  
<''port number''> = TCP port
+
<''port number''>: TCP port
  
 
|UNITS=
 
|UNITS=
Line 40: Line 39:
  
 
|LIMITATIONS=
 
|LIMITATIONS=
Task only
+
*Task only
 
+
*Errors: Cannot connect
Errors                  Cannot connect
+
*Optional Timeout from version 0.4.20.3r2
  
 
|EXAMPLE=
 
|EXAMPLE=
Connect(#1,”212.25.84.109”,65456)
+
OpenSocket Options=1 as #200<br>
 +
Connect(#200,"127.0.0.1",6002)<br>
 +
print Input$(LOC(200), #200) <br>
 +
close #200<br>
  
 
|SEE ALSO=
 
|SEE ALSO=
* [[Axystems:MC-Basic:CLOSE|CLOSE]]
+
* [[MC-Basic:CLOSE|CLOSE]]
* [[Axystems:MC-Basic:OPENSOCKET|OPENSOCKET]]
+
* [[MC-Basic:OPENSOCKET|OPENSOCKET]]
* [[Axystems:MC-Basic:ACCEPT|ACCEPT]]
+
* [[MC-Basic:ACCEPT|ACCEPT]]
* [[Axystems:MC-Basic:PING|PING]]
+
* [[MC-Basic:PING|PING]]
  
  
 
}}
 
}}

Latest revision as of 11:11, 27 November 2019

Language: English  • 中文(简体)‎

Requests a TCP connection from the remote host.

Syntax

Connect(#<device number>, <ip address>,<port number>{,<port number>})

Type

<device number>: Long
<port number>: Long
<ip address>: string
<timeout>: Long

Range

<device number>: 1 to 255

<ip address>: IP address

<port number>: TCP port

Scope

Task

Limitations

  • Task only
  • Errors: Cannot connect
  • Optional Timeout from version 0.4.20.3r2

Examples

OpenSocket Options=1 as #200
Connect(#200,"127.0.0.1",6002)
print Input$(LOC(200), #200)
close #200

See Also