1 | <?php |
||
10 | class Connection extends AbstractOptions |
||
11 | { |
||
12 | const SCHEME_TCP = 'tcp://'; |
||
13 | |||
14 | /** |
||
15 | * Hostname. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $host; |
||
20 | /** |
||
21 | * Connection scheme. |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $scheme = 'tcp://'; |
||
26 | /** |
||
27 | * Connection port. |
||
28 | * |
||
29 | * @var int |
||
30 | */ |
||
31 | protected $port = 5038; |
||
32 | /** |
||
33 | * Username. |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $username; |
||
38 | /** |
||
39 | * Password. |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $secret; |
||
44 | /** |
||
45 | * Connection timeout. |
||
46 | * |
||
47 | * @var int |
||
48 | */ |
||
49 | protected $connectTimeout = 10000; |
||
50 | /** |
||
51 | * Read timeout. |
||
52 | * |
||
53 | * @var int |
||
54 | */ |
||
55 | protected $readTimeout = 10000; |
||
56 | /** |
||
57 | * @var null|string[] |
||
58 | */ |
||
59 | protected $eventMask; |
||
60 | |||
61 | /** |
||
62 | * Return the host. |
||
63 | * |
||
64 | * @return string |
||
65 | */ |
||
66 | 3 | public function getHost() |
|
70 | |||
71 | /** |
||
72 | * Set the host. |
||
73 | * |
||
74 | * @param string $host IP address or hostname |
||
75 | * |
||
76 | * @return $this |
||
77 | */ |
||
78 | 3 | public function setHost($host) |
|
84 | |||
85 | /** |
||
86 | * Return the connection scheme. |
||
87 | * |
||
88 | * @return string |
||
89 | */ |
||
90 | 3 | public function getScheme() |
|
94 | |||
95 | /** |
||
96 | * Set the connection scheme. |
||
97 | * |
||
98 | * @param string $scheme Connection scheme |
||
99 | * |
||
100 | * @return $this |
||
101 | */ |
||
102 | 3 | public function setScheme($scheme) |
|
108 | |||
109 | /** |
||
110 | * Return the connection port. |
||
111 | * |
||
112 | * @return int |
||
113 | */ |
||
114 | 3 | public function getPort() |
|
118 | |||
119 | /** |
||
120 | * Set the connection port. |
||
121 | * |
||
122 | * @param int $port Connection port |
||
123 | * |
||
124 | * @return $this |
||
125 | */ |
||
126 | 3 | public function setPort($port) |
|
132 | |||
133 | /** |
||
134 | * Get the username. |
||
135 | * |
||
136 | * @return string |
||
137 | */ |
||
138 | 3 | public function getUsername() |
|
142 | |||
143 | /** |
||
144 | * Set the username. |
||
145 | * |
||
146 | * @param string $username Username |
||
147 | * |
||
148 | * @return $this |
||
149 | */ |
||
150 | 3 | public function setUsername($username) |
|
156 | |||
157 | /** |
||
158 | * Return the password. |
||
159 | * |
||
160 | * @return string |
||
161 | */ |
||
162 | 3 | public function getSecret() |
|
166 | |||
167 | /** |
||
168 | * Set the password. |
||
169 | * |
||
170 | * @param string $secret Password |
||
171 | * |
||
172 | * @return $this |
||
173 | */ |
||
174 | 3 | public function setSecret($secret) |
|
180 | |||
181 | /** |
||
182 | * Get the connection timeout in ms. |
||
183 | * |
||
184 | * @return int |
||
185 | */ |
||
186 | 3 | public function getConnectTimeout() |
|
190 | |||
191 | /** |
||
192 | * Set the connection timeout. |
||
193 | * |
||
194 | * @param int $connectTimeout Connection timeout in ms |
||
195 | * |
||
196 | * @return $this |
||
197 | */ |
||
198 | 3 | public function setConnectTimeout($connectTimeout) |
|
204 | |||
205 | /** |
||
206 | * Return the read timeout in ms. |
||
207 | * |
||
208 | * @return int |
||
209 | */ |
||
210 | 3 | public function getReadTimeout() |
|
214 | |||
215 | /** |
||
216 | * Set the read timeout. |
||
217 | * |
||
218 | * @param int $readTimeout Read timeout in ms |
||
219 | * |
||
220 | * @return $this |
||
221 | */ |
||
222 | 3 | public function setReadTimeout($readTimeout) |
|
228 | |||
229 | /** |
||
230 | * @return null|string[] |
||
231 | */ |
||
232 | 3 | public function getEventMask() |
|
236 | |||
237 | /** |
||
238 | * @param null|string[] $eventMask |
||
239 | */ |
||
240 | public function setEventMask(array $eventMask = null) |
||
244 | } |
||
245 |