Difference between revisions of "Simple connection"

From BeebWiki
Jump to: navigation, search
m (Added link to Net library.)
 
m (1 revision)
 
(2 intermediate revisions by the same user not shown)
(No difference)

Latest revision as of 19:13, 8 March 2015


   DIM ctrl% 15:X%=ctrl%:Y%=X%DIV256
   DIM rxBuf% 1,txBuf% 1:rxNum%=0
   :
   INPUT "Connect to:  "A$:stn%=FNNet_StnNum(A$)
   INPUT "Port number: "port%
   :
   ON ERROR REPORT:PROCNet_RxKill(rxNum%):PRINT:END
   rxNum%=FNNet_RxOpen(stn%,port%,rxBuf%,1)
   REPEAT
     REPEAT
       A%=INKEY(1):IFA%>-1:?txBuf%=A%:A%=FNNet_Tx(stn%,&80,port%,txBuf%,1)
     UNTIL FNNet_Rx(rxNum%)
     A%=FNNet_Read(rxNum%)
     VDU ?rxBuf%:IF?rxBuf%=13:VDU 10
     rxNum%=FNNet_Open(stn%,port%,rxBuf%,1)
   UNTIL FALSE

This code uses the Net library.

Jgharston 22:32, 14 May 2009 (UTC)