Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Eye-Tracking Classroom
/
gaze-server.cs
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
cbbd24f5
authored
Aug 20, 2019
by
Stefan Schreistetter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed problem where behavior was not correctly instantiated. Added null checking for sessions.
parent
27325516
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
GazeWebSocketServer/GazeCoordinateBehavior.cs
+1
-1
GazeWebSocketServer/Program.cs
+3
-2
No files found.
GazeWebSocketServer/GazeCoordinateBehavior.cs
View file @
cbbd24f5
...
@@ -30,7 +30,7 @@ namespace GazeWebSocketServer
...
@@ -30,7 +30,7 @@ namespace GazeWebSocketServer
internal
void
Publish
(
GazeData
gazeData
)
internal
void
Publish
(
GazeData
gazeData
)
{
{
Sessions
.
Broadcast
(
gazeData
.
ToString
());
Sessions
?
.
Broadcast
(
gazeData
.
ToString
());
}
}
}
}
}
}
GazeWebSocketServer/Program.cs
View file @
cbbd24f5
...
@@ -9,8 +9,9 @@ namespace GazeWebSocketServer
...
@@ -9,8 +9,9 @@ namespace GazeWebSocketServer
{
{
public
static
void
Main
(
string
[]
args
)
public
static
void
Main
(
string
[]
args
)
{
{
var
wssv
=
new
WebSocketServer
(
"ws://localhost:8001"
);
var
wssv
=
new
WebSocketServer
(
8001
);
wssv
.
AddWebSocketService
(
"/gaze"
,
()
=>
new
GazeCoordinateBehavior
());
GazeCoordinateBehavior
behavior
=
new
GazeCoordinateBehavior
();
wssv
.
AddWebSocketService
(
"/gaze"
,
()
=>
behavior
);
wssv
.
Start
();
wssv
.
Start
();
Console
.
ReadKey
(
true
);
Console
.
ReadKey
(
true
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment