Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Nicolas Pope
ftl
Commits
c9867f73
Commit
c9867f73
authored
4 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Fixes for web service uri binding
parent
2d0896e4
No related branches found
Branches containing commit
Tags
v0.0.5
Tags containing commit
No related merge requests found
Pipeline
#28521
failed
4 years ago
Stage: all
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
web-service/server/src/index.js
+12
-6
12 additions, 6 deletions
web-service/server/src/index.js
with
12 additions
and
6 deletions
web-service/server/src/index.js
+
12
−
6
View file @
c9867f73
...
...
@@ -76,8 +76,11 @@ function RGBDStream(uri, peer) {
this
.
rxcount
=
10
;
this
.
rxmax
=
10
;
let
ix
=
uri
.
indexOf
(
"
?
"
);
this
.
base_uri
=
(
ix
>=
0
)
?
uri
.
substring
(
0
,
ix
)
:
uri
;
// Add RPC handler to receive frames from the source
peer
.
bind
(
uri
,
(
latency
,
spacket
,
packet
)
=>
{
peer
.
bind
(
this
.
base_
uri
,
(
latency
,
spacket
,
packet
)
=>
{
// Forward frames to all clients
this
.
pushFrames
(
latency
,
spacket
,
packet
);
//this.rxcount++;
...
...
@@ -129,7 +132,7 @@ RGBDStream.prototype.pushFrames = function(latency, spacket, packet) {
//console.log("Frame = ", packet[0], packet[1]);
for
(
let
i
=
0
;
i
<
this
.
clients
.
length
;
i
++
)
{
this
.
clients
[
i
].
push
(
this
.
uri
,
latency
,
spacket
,
packet
);
this
.
clients
[
i
].
push
(
this
.
base_
uri
,
latency
,
spacket
,
packet
);
}
/*let i=0;
...
...
@@ -372,15 +375,18 @@ app.ws('/', (ws, req) => {
if
(
uri_to_peer
.
hasOwnProperty
(
parsedURI
))
{
console
.
log
(
"
Stream found:
"
,
uri
,
parsedURI
);
if
(
!
p
.
isBound
(
uri
))
{
console
.
log
(
"
Adding local stream binding
"
);
p
.
bind
(
uri
,
(
ttimeoff
,
spkt
,
pkt
)
=>
{
let
ix
=
uri
.
indexOf
(
"
?
"
);
let
base_uri
=
(
ix
>=
0
)
?
uri
.
substring
(
0
,
ix
)
:
uri
;
if
(
!
p
.
isBound
(
base_uri
))
{
console
.
log
(
"
Adding local stream binding:
"
,
base_uri
);
p
.
bind
(
base_uri
,
(
ttimeoff
,
spkt
,
pkt
)
=>
{
//console.log("STREAM: ", ttimeoff, spkt, pkt);
let
speer
=
uri_to_peer
[
parsedURI
];
if
(
speer
)
{
try
{
uri_data
[
parsedURI
].
addClient
(
p
);
speer
.
send
(
parsedURI
,
ttimeoff
,
spkt
,
pkt
);
speer
.
send
(
base_uri
,
ttimeoff
,
spkt
,
pkt
);
}
catch
(
e
)
{
console
.
error
(
"
EXCEPTION
"
,
e
);
}
...
...
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