Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d915e6cd
authored
Jan 14, 2018
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
socket timeout set to 5 seconds
parent
360185ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
sails/src/api/hooks/rooms.js
sails/src/api/hooks/rooms.js
View file @
d915e6cd
...
...
@@ -19,7 +19,7 @@ module.exports = function roomsHook (sails) {
* pdb_count (number of connections to the given room from Pictogram Web)
* pcb_count (number of connections to the given room from Pictogram Communicator/Supervisor)
*/
getUICount
:
function
(
room
)
{
getUICount
:
function
(
room
,
cb
)
{
// Let's count number of connections per room and per UI
var
counter
=
{
'PCB'
:
0
,
'PDB'
:
0
};
//console.log('notifyRoom (' + room + ')---->\n' + JSON.stringify(sockets) + '\n' + JSON.stringify(rooms));
...
...
@@ -34,7 +34,7 @@ module.exports = function roomsHook (sails) {
if
(
err
)
sails
.
debug
.
log
(
"Error when notifying room "
+
JSON
.
stringify
(
err
));
else
return
({
cb
({
'room'
:
room
,
'pdb_count'
:
counter
[
'PDB'
],
'pcb_count'
:
counter
[
'PCB'
]
...
...
@@ -49,10 +49,12 @@ module.exports = function roomsHook (sails) {
*/
notifyRoom
:
function
(
room
)
{
// Broadcast data to room's peers
sails
.
hooks
.
events
.
broadcastEvent
(
room
,
sails
.
hooks
.
events
.
roomSubscribersChange
(
sails
.
hooks
.
events
.
getUICount
(
room
));
);
sails
.
hooks
.
events
.
getUICount
(
room
,
(
info
)
=>
{
sails
.
hooks
.
events
.
broadcastEvent
(
room
,
sails
.
hooks
.
events
.
roomSubscribersChange
(
info
)
);
});
},
/**************************************************************************
...
...
@@ -189,6 +191,5 @@ module.exports = function roomsHook (sails) {
sails
.
hooks
.
rooms
.
unsubscribeFromRoom
(
sockets
[
socket
.
id
].
sup_room
,
socket
);
}
}
};
};
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