Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 6 made on Monday April 20, 2009 at 14:25
Phoenix_Elite
Long Time Member
Joined:
Posts:
July 2007
123
This worked for me. Right now you can just call connectSocket() from a page script, but you can dissect it and make it work with your configuration.


var socket_A;
var receivedData = "";

function connectSocket()
{
   socket_A = new TCPSocket(false);

   socket_A.onConnect = function()
   {
      System.print('Connected !');
      label = 'connected';
      socket_A.write('GET /pictures/unes/clones-home.jpg HTTP/1.0\r\n');
      socket_A.write("HOST:www.macgeneration.com\r\n\r\n");
   };

   socket_A.onData = function()
   {
      System.print('Receving !');
      receivedData += socket_A.read();
      System.print(receivedData);
   };

   socket_A.onError = function(e)
   {
      System.print('On IOError !');
      System.print(e);
   };

   socket_A.onClose = function()
   {
      System.print('On Close !');
      // remove the HTTP information from the received data
      var imageStartIndex = receivedData.indexOf("\r\n\r\n");
      var bitmapData =       receivedData.substring(imageStartIndex+4);

      // make and display the image
      var MyImage = new Image(bitmapData);
      GUI.widget("output").setImage(MyImage);
   };

   socket_A.connect('[Link: macgeneration.com]);
}


Hosting Services by ipHouse