Now only i have found some changes in my application after it stops responding.In my Application the server accepts response from the application via socket.on like below
socket.on('check_open_id',function(data){
console.log("New message from application" + data);
data.socket_session_id = socket.id;
console.log("New message from Application Socket Session Id" + data.socket_session_id);
//Function to check the registration details
checkRegisterationDetails(data);
});
and it respond with showing output in console. and it run the function in it. in that function
var checkRegisterationDetails= function(data){
console.log("Testing Registered");
console.log(data);
var query = connection.query('select * from test where open_id = "'+data.openid+'"');
result=[];
query
.on('error', function(err) {
// Handle error, and 'end' event will be emitted after this as well
console.log(err);
//updateSockets(err);
})
.on('result', function(user) {
// it fills our array looping on each user row inside the db
result.push(user);
//console.log("openid"+result);
})
.on('end', function() {
console.log(result.length);
io.sockets.socket(data.socket_session_id).emit('check_registration_status', {message:"your registration already completes and no engaged booking",details : details[0]});
})
}
here also it give output in the console window but the queries are not executed and as well the socket.emit also not executed. can any body tell how to over come this problem. these problem arises after certain period from server starts. when it restarts it works fine untill some period.