@@ -37,9 +37,9 @@ class Server
37
37
private $ icpSocket ;
38
38
39
39
/**
40
- * @var string $ipcSocketPath
40
+ * @var null| string $ipcSocketPath
41
41
*/
42
- private string $ ipcSocketPath ;
42
+ private ? string $ ipcSocketPath ;
43
43
44
44
/**
45
45
* @var string $ipcOwner If set, owner of the ipc socket will be changed to this value.
@@ -114,12 +114,12 @@ class Server
114
114
/**
115
115
* @param string $host
116
116
* @param int $port
117
- * @param string $ipcSocketPath
117
+ * @param null| string $ipcSocketPath
118
118
*/
119
119
public function __construct (
120
120
string $ host = 'localhost ' ,
121
121
int $ port = 8000 ,
122
- string $ ipcSocketPath = '/tmp/phpwss.sock '
122
+ ? string $ ipcSocketPath = '/tmp/phpwss.sock '
123
123
) {
124
124
$ this ->host = $ host ;
125
125
$ this ->port = $ port ;
@@ -137,12 +137,13 @@ public function run(): void
137
137
{
138
138
ob_implicit_flush ();
139
139
$ this ->createSocket ($ this ->host , $ this ->port );
140
- $ this ->openIPCSocket ($ this ->ipcSocketPath );
140
+ if ($ this ->ipcSocketPath )
141
+ $ this ->openIPCSocket ($ this ->ipcSocketPath );
141
142
$ this ->log ('Server created ' );
142
143
143
144
while (true ) {
144
145
$ this ->timers ->runAll ();
145
-
146
+
146
147
$ changed_sockets = $ this ->allsockets ;
147
148
@stream_select ($ changed_sockets , $ write , $ except , 0 , 5000 );
148
149
foreach ($ changed_sockets as $ socket ) {
0 commit comments