Hi,
Thanks for the recommendations and sorry about my delayed reply Vinod. I was using a different code than the one posted by pramod and I found the problem on mine. There were a couple of validations made every time the code ran, reading data from the website I was trying to connect to and then validating whether the client was still connected.
The example I used as a baseline made updates every 5 minutes and in my case I needed to send the udpates that were event triggered, so I got read of the two validations, forcing the client to connect when the event took place and diisconnect right after the update was made.
I hope this makes sense.
Alonso