Try this... you cannot read the socket synchronously if doing async. You also need to be reading within onData. Look at the changes in bold below.
var url = CF.widget("Kodi_aURL","Kodi_PARAMETERS_test").label;
var info;
function kodi(command) {
var socket = new TCPSocket();
socket.onConnect = function() {
prefix = 'GET /jsonrpc?request='
postfix = ' HTTP/1.0\r\n"'
try {
socket.write(prefix+command+postfix);
socket.write("HOST:+url+\r\n\r\n");
} catch(e) {
socket.close()
}}
socket.onData = function() {
info = socket.read();
CF.widget("KODI_INFO").label=info;
socket.close()
}
socket.onIOError = function(e) {
socket.close()
}
socket.connect(url, 9090, 300);
};