1 | <?php |
||
5 | class ClientStreamSocket { |
||
6 | const FASTAPNS_DEFAULT_GATEWAY_HOST = 'gateway.push.apple.com'; |
||
7 | const FASTAPNS_DEFAULT_GATEWAY_PORT = 2195; |
||
8 | const FASTAPNS_STATUS_TIMEOUT = 3; |
||
9 | |||
10 | const FASTAPNS_WRITE_SUCCESS = 1; |
||
11 | const FASTAPNS_STATUS_WRITABLE = 2; |
||
12 | const FASTAPNS_STATUS_READABLE = 3; |
||
13 | const FASTAPNS_STATUS_NONE = 4; |
||
14 | |||
15 | private $local_cert; |
||
16 | private $passphrase; |
||
17 | private $host; |
||
18 | private $port; |
||
19 | |||
20 | private $stream_socket_client; |
||
21 | |||
22 | public function __construct($local_cert, $passphrase = '', $host = ClientStreamSocket::FASTAPNS_DEFAULT_GATEWAY_HOST, $port = ClientStreamSocket::FASTAPNS_DEFAULT_GATEWAY_PORT) { |
||
28 | |||
29 | public function connect() { |
||
41 | |||
42 | public function disconnect() { |
||
45 | |||
46 | public function reconnect() { |
||
50 | |||
51 | public function isConnected() { |
||
54 | |||
55 | /** |
||
56 | * @param $notification_bytes |
||
57 | * @return bool |
||
58 | */ |
||
59 | public function write($notification_bytes) { |
||
68 | |||
69 | public function read() { |
||
74 | |||
75 | public function readFeedback() { |
||
88 | |||
89 | public function status($readOnly = FALSE) { |
||
106 | } |
||
107 |