OSDN Git Service

e5b45b50098504def44284288383b12717d6d52f
[bacon/BaCon-Japanese.git] / 関数・命令 / RECEIVE.txt
1   RECEIVE
2
3    RECEIVE <var> FROM <handle> [CHUNK <size> [SIZE <amount>]]
4
5    Type: statement
6
7    変数またはメモリの領域に <handle> のネットからデータを読みます。
8    CHUNK <size> で読み込み量を指定する事ができます。
9    指定がない場合はバッファが空になるまで、データを読みます。
10
11    実際に受信する量は SIZE <amount> で設定します。 If the amount of bytes received is 0, then the other side has closed the connection in an orderly fashion. In such a situation the network connection needs to be reopened.
12    例:
13
14    OPEN "www.google.com:80" FOR NETWORK AS mynet
15    SEND "GET / HTTP/1.1\r\nHost: www.google.com\r\n\r\n" TO mynet
16    REPEAT
17        RECEIVE dat$ FROM mynet
18        total$ = CONCAT$(total$, dat$)
19    UNTIL ISFALSE(WAIT(mynet, 500))
20    CLOSE NETWORK mynet
21