Add some stuff to prevent connection errors

Hi!

We use this library in our application and we send thousands of push notifications every day. 
And quite often we received connection errors. I added some socket connection options to prevent connection errors. With this options we didn't get any connection errors for almost two weeks.