I have un problem with socket.The error is " Maximum active socket count reached" but I close the socket I don't understand why the maximum socket count is reached.
if (clicks >= 3) { socket_bri=null; var socket_bri = new TCPSocket(false); brightness=parseInt(brightness)+5*clicks<=255?parseInt(brightness)+5*clicks:255; var JSON_commande='{"bri":'+brightness+'}'; socket_bri.connect('192.168.0.158', 80, 3000);
function setBright(commands) { socket_bri.write('PUT /api/newdeveloper/groups/all/action HTTP/1.1\r\nContent-Length: '+commands.length+'\r\n\r\n'+commands);