Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
technobel.sf
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mathieu
technobel.sf
Commits
3250da39
Commit
3250da39
authored
Jul 02, 2018
by
Mat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
une autre méthode pour initialiser le serveur websocket
parent
b977d9f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
src/SocketBundle/Command/WsCommand.php
src/SocketBundle/Command/WsCommand.php
+11
-2
No files found.
src/SocketBundle/Command/WsCommand.php
View file @
3250da39
...
...
@@ -9,6 +9,7 @@
namespace
SocketBundle\Command
;
use
Ratchet\App
;
use
Ratchet\Http\HttpServer
;
use
Ratchet\Server\IoServer
;
use
Ratchet\WebSocket\WsServer
;
...
...
@@ -39,15 +40,23 @@ class WsCommand extends ContainerAwareCommand
protected
function
execute
(
InputInterface
$input
,
OutputInterface
$output
)
{
$output
->
write
(
"Tentative de connexion au chat"
);
/*
// méthode 1
$server = IoServer::factory(
new HttpServer(
new WsServer(
new ChatHub($this->getContainer())
)
),
8088
), 8088
, '/'
);
$server
->
run
();
*/
// méthode 2
$server
=
new
App
(
'localhost'
,
8088
);
$server
->
route
(
'/'
,
new
ChatHub
(
$this
->
getContainer
()));
$server
->
run
();
//parent::execute($input, $output); // pas nécessaire ici
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment