APNSSocket class handles socket connections.