Question: how do i go about reading data being sent almost constantly to my server.
the protocol is udp. if i try to read in a while(1) loop, i dont get anything. it seems like the read will only echo once all the reading is done. so it waits till the loop is done reading which it will never be. i want the socket\_read to echo immediately when it gets the data. here is the code that doesnt work. thanks in advance.

```
<?php
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_bind($sock, $local, $port) or die('Could not bind to address');

//this is where the reading loop should go.
while(1)
{
    echo socket_read($sock,1024);
}

socket_close($sock);
?>

```

Answer: 
Using GWT, there is no way to read files on the client side **yet**. However, in HTML5, you can read files without uploading to a server using the "File API".

Links are provided below.

[File API tutorial on html5rocks.com](http://www.html5rocks.com/en/tutorials/file/dndfiles/)

[Example of how to use File API in GWT via JSNI](http://code.google.com/p/gwt-nes-port/wiki/FileAPI)
Do you mean from an `<input type="file"...>` file upload field in a form?

The short answer is no-- file uploads are handled by the browser, and are sent directly to the server (as an ENCODING\_MULTIPART POST). And security restrictions on JavaScript mean there's no way to workaround that restriction.