User`s guide
Chapter
5
BASIC
Commands
133
Remarks
Note that the function must be called before using any socket read/write commands.
"N%" is an integer variable in the range of 0 to 3, indicating the connection number.
"IP$" is a string variable, indicating the IP address of the remote port. If it is set to
"0.0.0.0", the connection will become server mode and the LP% must be defined.
"RP%" is an integer variable, indicating the port number of the remote port, which
is to be connected. If it is 0 (=none), any remote port is available. However, it has to
be set to 0 when in server mode.
"LP%" is an integer variable, indicating the port number of the local port. If it is 0
(=none), the port number will be defined by the system. However, it has to be set to
0 when in client mode.
Server mode Client mode
N% 0 ~ 3 0 ~ 3
IP$ “0.0.0.0” Required
RP% 0 Required
LP% Required 0
"Protocol%" is an integer variable, indicating the networking protocol in use. This
parameter is optional and it is set to 0 by default (using TCP/IP protocol). If it is set
to 1, the system will use UDP/IP protocol.
"Delimiter%" is an integer variable, indicating whether to transmit the delimiter or
not. This parameter is optional and it is set to 0x0d (Carriage Return) by default.
The valid values range from 0 to 255. If it is set to -1, the system will not transmit
any delimiter.
Example
TCP_OPEN (0, "0.0.0.0", 0, 23)
TCP_OPEN (1, "0.0.0.0", 0, 24)
TCP_OPEN (2, "0.0.0.0", 0, 25, 1)
TCP_OPEN (3, "0.0.0.0", 0, 26, 0, 59)
See Also
GET_TCPIP_MESSAGE, NCLOSE, NREAD$, NWRITE, OFF TCPIP, ON
TCPIP GOSUB…, SOCKET_CAN_SEND, SOCKET_HAS_DATA,
SOCKET_OPEN, START TCPIP, STOP TCPIP, TCP_ERR_CODE
TCP/IP Practice
TCP/IP Configuration
The parameters can be accessed via GET_NET_PARAMETER$ and
SET_NET_PARAMETER.
Programming Flow
1. Set networking variables (SET_NET_PARAMETER)