Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99449547
index.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jan 24, 16:20
Size
1 KB
Mime Type
text/x-c++
Expires
Sun, Jan 26, 16:20 (2 d)
Engine
blob
Format
Raw Data
Handle
23803427
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
index.js
View Options
"use strict"
;
var
__importDefault
=
(
this
&&
this
.
__importDefault
)
||
function
(
mod
)
{
return
(
mod
&&
mod
.
__esModule
)
?
mod
:
{
"default"
:
mod
};
};
Object
.
defineProperty
(
exports
,
"__esModule"
,
{
value
:
true
});
exports
.
Browser
=
exports
.
Service
=
exports
.
Bonjour
=
void
0
;
const
registry_1
=
__importDefault
(
require
(
"./lib/registry"
));
const
mdns_server_1
=
__importDefault
(
require
(
"./lib/mdns-server"
));
const
browser_1
=
__importDefault
(
require
(
"./lib/browser"
));
exports
.
Browser
=
browser_1
.
default
;
const
service_1
=
__importDefault
(
require
(
"./lib/service"
));
exports
.
Service
=
service_1
.
default
;
class
Bonjour
{
constructor
(
opts
,
errorCallback
)
{
this
.
server
=
new
mdns_server_1
.
default
(
opts
,
errorCallback
);
this
.
registry
=
new
registry_1
.
default
(
this
.
server
);
}
publish
(
opts
)
{
return
this
.
registry
.
publish
(
opts
);
}
unpublishAll
(
callback
)
{
return
this
.
registry
.
unpublishAll
(
callback
);
}
find
(
opts
=
undefined
,
onup
)
{
return
new
browser_1
.
default
(
this
.
server
.
mdns
,
opts
,
onup
);
}
findOne
(
opts
=
undefined
,
timeout
=
10000
,
callback
)
{
const
browser
=
new
browser_1
.
default
(
this
.
server
.
mdns
,
opts
);
var
timer
;
browser
.
once
(
'up'
,
(
service
)
=>
{
if
(
timer
!==
undefined
)
clearTimeout
(
timer
);
browser
.
stop
();
if
(
callback
)
callback
(
service
);
});
timer
=
setTimeout
(()
=>
{
browser
.
stop
();
if
(
callback
)
callback
(
null
);
},
timeout
);
return
browser
;
}
destroy
()
{
this
.
registry
.
destroy
();
this
.
server
.
mdns
.
destroy
();
}
}
exports
.
Bonjour
=
Bonjour
;
exports
.
default
=
Bonjour
;
//# sourceMappingURL=index.js.map
Event Timeline
Log In to Comment