NETCONNECTSENDVALUE

Synopsis
NETCONNECTSENDVALUE data
Description

Sends data out the connection that was created with NETCONNECTON.

The data input may be a word, a list, or an array. The data are sent as if printed by PRINT, without the final newline. The network payload is encoded according to the system default Windows code page of the host operating system, followed by a 0 byte.

NETCONNECTSENDVALUE outputs TRUE if the data were successfully queued to be sent. Otherwise, it outputs FALSE (meaning that it's not ready to send). If it outputs FALSE, you must wait until the sendready instruction list input of NETCONNECTON is run and then try sending the data again.

Example

The following example sets up both a client and a server. The client (connector) sends data to the server (accepter).

NETSTARTUP ; Start up the network

; Wait for someone to connect to you on port 5124
SHOW NETACCEPTON 5124 [] [PRINT NETACCEPTRECEIVEVALUE]
true

; Connect to local machine on port 5124
; If you want to run this portion on a different computer, then replace
; the "localhost with the name of the other computer.
SHOW NETCONNECTON "localhost 5124 [PRINT [Ok to Send Again]] []
true

WAIT 100 ; Wait a little to establish the connection
Ok to Send Again
Ok to Send Again
Ok to Send Again

SHOW NETCONNECTSENDVALUE [Hello thanks for taking my call] ; Send some data
true

WAIT 100 ; Wait a little before we shut things down
Hello thanks for taking my call

NETCONNECTOFF
NETACCEPTOFF
NETSHUTDOWN


SourceForge.net Logo