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 3 made on Saturday January 28, 2012 at 17:29
xynyx
Long Time Member
Joined:
Posts:
September 2009
73
Lyndel,
Thnx for the elaborate reply!
Im building my own script for Logitech Media server. The server listens on port 9090 for TCP/IP connections. I can control the squeezebox allready, but getting notifications was proving difficult (for me).
Furthermore i dont use the onClose, because the server doesnt close the socket. It stays open. With "\n" as last character the server signals the end of the reply.
Anyway thnx again. This forum would be dead if it wasn't for you!
(No offence to others, but you get my drift)

jeroen

Shortent code:
function tcpcom(){
if(LMSsocket != null){System.print("Closing socket first");LMSsocket.close(); LMSsocket=null}
LMSsocket = new TCPSocket(false);
LMSsocket.onConnect = function(){LMSsocket.write(command)}
LMSsocket.onIOError = function (e) {GUI.widget("ERRpanel").label = "IOError " + e}
LMSsocket.onData = function(){result += LMSsocket.read(); resultlen = result.length;
if(result.substr(resultlen-1) == "\n"){result = result.substr(0,resultlen-1);
switch(check){
case "Player 0 ID":PlayerID = decodeURIComponent(result.substr (comlen+1)); GUI.widget("L1").visible=true;Terminate();break
//.....
}}}
LMSsocket.connect(LMS.host, LMS.TCPport, LMS.duration);
}

function Terminate(){
if(LMSsocket!=null){LMSsocket.close();LMSsocket=null;}
}

Last edited by xynyx on February 11, 2012 04:42.


Hosting Services by ipHouse