Prev | Current Page 599 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

txt file containing the string:
abcabcdeabcijabcdefghij
What ??™ s happened is, the string abcdefghij was written to the stream. From there, the head was moved
forward three places from the end of the stream, and the string was then rewritten, making the stream
twenty - three characters in length. The head was then moved to the third character in the stream and the
content was written again, leaving the marker at position thirteen. Finally, the marker was moved
backward five places, and the string was once again written to the stream.
??‘
??‘
??‘
311
Chapter 11: Performing Server-Side Trickery
Accessing a Remote File
Earlier in this book, you looked at how to send data to a remote location using the haxe.Http class. In
Neko, and indeed JavaScript, you can also use this class to request data. This is done via the request
method, and like the neko.io.File.getContent method, it doesn ??™ t require streams:
var string = haxe.Http.request( strURLOfPageToRequest );
The haxe.Http method performs a blocking IO, so all code performed after the request will not occur
until the request has completed.


Pages:
587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611