FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
koding/node_modules_koding/koding-dnode/test/simple.js at master · koding/koding · GitHub
This repository was archived by the owner on Aug 15, 2022. It is now read-only.
koding
/
koding
Public archive
Notifications
You must be signed in to change notification settings
Fork
604
Star
2.2k
Code
Issues
246
Pull requests
6
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
koding
/
node_modules_koding
/
koding-dnode
/
test
/
simple.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
39 lines (35 loc) · 1.16 KB
Breadcrumbs
koding
/
node_modules_koding
/
koding-dnode
/
test
/
simple.js
Copy path
File metadata and controls
executable file
·
39 lines (35 loc) · 1.16 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
var
dnode
=
require
(
'../'
)
;
var
test
=
require
(
'tap'
)
.
test
;
test
(
'simple'
,
function
(
t
)
{
t
.
plan
(
7
)
;
var
port
=
Math
.
floor
(
Math
.
random
(
)
*
40000
+
10000
)
;
var
server
=
dnode
(
{
timesTen
:
function
(
n
,
reply
)
{
t
.
equal
(
n
,
50
)
;
reply
(
n
*
10
)
;
}
,
moo
:
function
(
reply
)
{
reply
(
100
)
}
,
sTimesTen
:
function
(
n
,
cb
)
{
t
.
equal
(
n
,
5
)
;
cb
(
n
*
10
)
;
}
,
}
)
.
listen
(
port
.
toString
(
)
)
;
// test for stringified ports too why not
server
.
on
(
'ready'
,
function
(
)
{
dnode
.
connect
(
port
,
function
(
remote
,
conn
)
{
t
.
ok
(
conn
.
id
)
;
t
.
equal
(
conn
.
stream
.
remoteAddress
,
'127.0.0.1'
)
;
remote
.
moo
(
function
(
x
)
{
t
.
equal
(
x
,
100
,
'remote moo == 100'
)
;
}
)
;
remote
.
sTimesTen
(
5
,
function
(
m
)
{
t
.
equal
(
m
,
50
,
'5 * 10 == 50'
)
;
remote
.
timesTen
(
m
,
function
(
n
)
{
t
.
equal
(
n
,
500
,
'50 * 10 == 500'
)
;
conn
.
end
(
)
;
server
.
close
(
)
;
t
.
end
(
)
;
}
)
;
}
)
;
}
)
;
}
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL