Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cs425-mp2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
arshiam2
cs425-mp2
Commits
afd611d6
There was an error fetching the commit references. Please try again later.
Commit
afd611d6
authored
6 years ago
by
arshiam2
Browse files
Options
Downloads
Patches
Plain Diff
wip
parent
986e49bc
No related branches found
No related tags found
1 merge request
!2
WIP: Old 4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cli/src/commands/whoami.js
+0
-32
0 additions, 32 deletions
cli/src/commands/whoami.js
inroducer/index.js
+1
-0
1 addition, 0 deletions
inroducer/index.js
with
1 addition
and
32 deletions
cli/src/commands/whoami.js
deleted
100644 → 0
+
0
−
32
View file @
986e49bc
// @flow
const
path
=
require
(
"
path
"
);
const
chalk
=
require
(
"
chalk
"
);
const
handleErrors
=
require
(
"
../utils/handleErrors
"
);
module
.
exports
.
command
=
"
whoami
"
;
module
.
exports
.
describe
=
"
test commands
"
;
module
.
exports
.
builder
=
(
yargs
:
any
)
=>
yargs
;
const
PORT
=
20000
;
const
MULTICAST_ADDR
=
"
233.255.255.255
"
;
const
HOST
=
"
172.22.158.15
"
;
const
dgram
=
require
(
"
dgram
"
);
const
process
=
require
(
"
process
"
);
const
socket
=
dgram
.
createSocket
({
type
:
"
udp4
"
,
reuseAddr
:
true
});
socket
.
bind
(
PORT
);
function
sendMessage
()
{
const
message
=
Buffer
.
from
(
`cli
${
process
.
pid
}
`
);
socket
.
send
(
message
,
0
,
message
.
length
,
PORT
,
HOST
,
function
()
{});
}
module
.
exports
.
handler
=
handleErrors
(
async
(
argv
:
{})
=>
{
console
.
log
(
"
Sending message to introducer
"
)
await
sendMessage
();
process
.
exit
(
0
);
});
This diff is collapsed.
Click to expand it.
inroducer/index.js
+
1
−
0
View file @
afd611d6
...
...
@@ -148,6 +148,7 @@ socket.on("message", function(message, rinfo) {
if
(
text
[
0
]
===
"
dead
"
)
{
console
.
log
(
"
Killed
"
+
text
[
1
].
toString
()[
0
])
const
ondLength
=
machines
.
length
machines
=
machines
.
filter
(
m
=>
m
.
toString
()[
0
]
!==
text
[
1
].
toString
()[
0
]);
getPairings
(
machines
);
...
...
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