Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
capstone-server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Neil Harlow
capstone-server
Commits
f6dd99cb
Commit
f6dd99cb
authored
9 years ago
by
Neil
Browse files
Options
Downloads
Patches
Plain Diff
I kinda forgot what I did here... sorry for the bad commit message future self.
parent
1b6a170c
Branches
master
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server.js
+3
-5
3 additions, 5 deletions
server.js
with
3 additions
and
5 deletions
server.js
+
3
−
5
View file @
f6dd99cb
...
...
@@ -57,11 +57,10 @@ Proxy.prototype.clientConnected = function( client ) {
case
PROTOCOL
.
CONTENT_CLIENTS
:
console
.
log
(
'
\t
Recieved request for list of [CLIENTS]
'
);
// Send back a list of clients that are not currently connected to someone.
var
unconnectedClients
=
"
192.168.1.77
\t
192.168.1.23
"
;
var
unconnectedClients
=
""
;
for
(
var
key
in
Proxy
.
prototype
.
clientPool
)
{
if
(
Proxy
.
prototype
.
clientPool
.
hasOwnProperty
(
key
))
{
var
potentialClient
=
Proxy
.
prototype
.
clientPool
[
key
];
// TODO: check that this client is yourself
if
(
potentialClient
.
connectedTo
===
undefined
)
unconnectedClients
+=
"
\t
"
+
potentialClient
.
formattedAddress
;
}
...
...
@@ -132,7 +131,7 @@ Proxy.prototype.clientConnected = function( client ) {
if
(
client
.
connectedTo
!==
undefined
)
{
connectedToClient
=
Proxy
.
prototype
.
clientPool
[
client
.
connectedTo
];
if
(
connectedToClient
)
connectedToClient
.
close
();
connectedToClient
.
end
();
Proxy
.
prototype
.
removeClient
(
connectedToClient
);
}
Proxy
.
prototype
.
removeClient
(
client
);
...
...
@@ -154,9 +153,8 @@ Proxy.prototype.emitClientPool = function () {
for
(
var
key
in
Proxy
.
prototype
.
clientPool
)
{
if
(
Proxy
.
prototype
.
clientPool
.
hasOwnProperty
(
key
))
{
var
potentialClient
=
Proxy
.
prototype
.
clientPool
[
key
];
// TODO: check that this client is yourself
if
(
potentialClient
.
connectedTo
===
undefined
)
unconnectedClients
+=
"
\t
"
+
potentialClient
.
formattedAddress
;
unconnectedClients
+=
"
\t
"
+
potentialClient
.
formattedAddress
;
}
}
// 2. Now emit that list of clients to everyone not connected to someone
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment