NETACCEPTSENDVALUE

Synopsis
NETACCEPTSENDVALUE data
Description

Sends data out the accept socket.

NETACCEPTSENDVALUE outputs TRUE if 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 input list of NETACCEPTON is run before sending on it again.

The data input is a list. It contains the data you wish to send over the network.

Example

This example sets up a client and server on the same machine. The server (accepter) sends data to whomever connected.

NETSTARTUP ; Start up the network

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

; Connect to the 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 little for connection to establish
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