1 | <?php |
||
4 | abstract class BaseConnection implements ConnectionInterface |
||
5 | { |
||
6 | /** |
||
7 | * Host |
||
8 | * |
||
9 | * @var string |
||
10 | */ |
||
11 | protected $host; |
||
12 | |||
13 | /** |
||
14 | * Port |
||
15 | * |
||
16 | * @var int |
||
17 | */ |
||
18 | protected $port; |
||
19 | |||
20 | /** |
||
21 | * Create a new connection defaulting to localhost:7711 |
||
22 | * |
||
23 | * @param string $host Host |
||
24 | * @param int $port Port |
||
25 | */ |
||
26 | public function __construct($host = 'localhost', $port = 7711) |
||
31 | |||
32 | /** |
||
33 | * Make sure the connection is closed |
||
34 | */ |
||
35 | public function __destruct() |
||
39 | |||
40 | /** |
||
41 | * @inheritdoc |
||
42 | */ |
||
43 | public function setHost($host) |
||
47 | |||
48 | /** |
||
49 | * @inheritdoc |
||
50 | */ |
||
51 | public function setPort($port) |
||
55 | |||
56 | /** |
||
57 | * @inheritdoc |
||
58 | */ |
||
59 | public function connect($connectionTimeout = null, $responseTimeout = null) |
||
65 | } |
||
66 |