This is nothing like the Input command. With the Input command you are able to type something, this just waits for something to arrive on the stream.
Code archives/Networking/InputTCP$
This code has been declared by its author to be Public Domain code.
Download source code
| I wrote this function for a remote control command line program I was writing. I suddenly realised it workd exactly like the Input command, halting execution until some data comes over input_stream, which it then returns. |
Function InputTCP$(input_stream) Repeat ;no operation because we're just waiting for something to come up on the TCP stream Until(ReadAvail(input_stream)) ret_val$=ReadLine(input_stream) Return (ret_val$) End Function |
Comments
The input command wait for data to arrive via the console.
This function waits for it to arrive via a socket.
It is similar functionality.
This function waits for it to arrive via a socket.
It is similar functionality.
It should be titled WaitTCP, so it isn't so misleading. You aren't doing any inputting, you are just waiting.
BTW, I think the variables are incorrect inside the function. "remote_stream" should be "input_stream".
BTW, I think the variables are incorrect inside the function. "remote_stream" should be "input_stream".
Wow, this is still the most recent piece of networking code!