Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
JavaScript
Var isConnected = false;


JavaScript
$.connection.hub.start().done(function () 
{

console.log('Now connected, connection ID=' + $.connection.hub.id);.

});


function StartStream(mac,ip,port) {

linkConditioningHubstart.server.startstreaming(mac, ip, port)
       
}

Hi,

When my page load the hub connection is also loaded.I set one flag

var isConnected = false;

Now how to check connection is true or false using the flag.
if isConnected is true means i call the function startstream method.

Where to use that flag and how to set true or false.

Please Help Me....
Posted
Comments
ZurdoDev 12-May-15 8:39am    
This does not make any sense. You already know how to set the flag, for you did it when you did var isConnected = false;

I don't understand what your question is.

1 solution

JavaScript
$.connection.hub.start().done(function () 
{
isConnected=true;
console.log('Now connected, connection ID=' + $.connection.hub.id);.
 
});
 

function StartStream(mac,ip,port) {
 
linkConditioningHubstart.server.startstreaming(mac, ip, port)
       
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900