NETCONNECTRECEIVEVALUE

Synopsis
NETCONNECTRECEIVEVALUE
Description

Outputs the value of the last network data received on the connection that was created with NETCONNECTON. The output is a list, as if parsed by PARSE.

The network data is interpreted as characters encoded in the system default Windows code page of the host operating system. As a result, it may not be possible to receive data from an instance of FMSLogo that is running on an operating system which is configured for a different language than yours.

It is best to call this procedure in your receiveready callback code of your NETCONNECTON command. If you don't, then the data is discarded the next time receiveready is run.

Example

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

NETSTARTUP ; Start up the network

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

; 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 NETCONNECTRECEIVEVALUE]
true

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

SHOW NETACCEPTSENDVALUE [Who are you that called me] ; Send some data
true

WAIT 100 ; Wait a little before we shut things down
Who are you that called me

NETCONNECTOFF
NETACCEPTOFF
NETSHUTDOWN


SourceForge.net Logo