454
’Initialize socket identifier set
’<----- Equivalent to BSD4.4 socket API FD_ZERO macro
CALL "SOCKET.FN3" .fcFDZERO R.SOCKSET$
’Initialize read socket identifier set
CALL "SOCKET.FN3" .fcFDZERO W.SOCKSET$
’Initialize write socket identifier
’set
CALL "SOCKET.FN3" .fcFDZERO E.SOCKSET$
’Initialize exception socket
’identifier set
’Add socket identifier to read socket identifier set
’<----- Equivalent to BSD4.4 socket API FD_SET macro
CALL "SOCKET.FN3" .fcFDSET SOCKFD%, R.SOCKSET$
’Wait for changes in socket identifier set (read condition)
’< ----- Equivalent to BSD4.4 socket API select () function
MAXFD% = SOCKFD% +1
’Specify number of socket identifiers
TIMEOUT = 360
’Specify 6-minute (360-second) timeout
CALL "SOCKET.FN3" .fcSelect MAXFD%, R.SOCKSET$, W.SOCKSET$, E.SOCKSET$,
TIMEOUT, RESULT%
IF RESULT% = 0 THEN
’Timeout occurred
’Processing for timeout
END IF
’Get socket identifier status from read socket identifier set
’< ----- Equivalent to BSD4.4 socket API FD_ISSET macro
CALL "SOCKET.FN3" .fcFDISSET SOCKFD%, R.SOCKSET$, FDISSET%
IF FDISSET% = 0 THEN
’No receive data
’Processing for no receive data
END IF
’Receive data < ----- Equivalent to BSD4.4 socket API recv () function
RECVLEN% = 255
RECVMODE% = 0
CALL "SOCKET.FN3" .fcRecv SOCKFD%, RECVBUFF$, RECVLEN%, RECVMODE%, RECVSIZE%
’Close socket < ----- Equivalent to BSD4.4 socket API close () function
CALL "SOCKET.FN3" .fcClose SOCKFD%
RETURN
Summary of Contents for BHT-BASIC 100 SERIES
Page 1: ......
Page 161: ...153 Chapter 10 Sleep Function CONTENTS 10 1 Sleep Function 154...
Page 163: ...155 Chapter 11 Resume Function CONTENTS 11 1 Resume Function 156...
Page 173: ...165 Chapter 13 Backlight Function CONTENTS 13 1 Backlight Function 166...
Page 249: ...241 Example CLOSE IF kyIn Y THEN KILL Master Dat END IF Reference Statements CLFILE...