Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3d03253

Browse files
committed
Setup listener
1 parent 7612af9 commit 3d03253

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

‎Server.php‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,18 @@ public function bind() {
6060

6161
}
6262

63+
public function listen() {
64+
65+
if (!socket_listen($this->server)) {
66+
throw new Exception('Failed to listen');
67+
}
68+
69+
if (!$this->client = socket_accept($this->server)) {
70+
throw new Exception('Failed to accept');
71+
}
72+
73+
return $this;
74+
75+
}
76+
6377
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /