Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
464b8951
Commit
464b8951
authored
Apr 09, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added enum for websocket opcodes
parent
05d7b7c8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
mongoose.c
mongoose.c
+1
-1
mongoose.h
mongoose.h
+10
-0
No files found.
mongoose.c
View file @
464b8951
...
@@ -2639,7 +2639,7 @@ static void send_websocket_handshake_if_requested(struct mg_connection *conn) {
...
@@ -2639,7 +2639,7 @@ static void send_websocket_handshake_if_requested(struct mg_connection *conn) {
static
void
ping_idle_websocket_connection
(
struct
connection
*
conn
,
time_t
t
)
{
static
void
ping_idle_websocket_connection
(
struct
connection
*
conn
,
time_t
t
)
{
if
(
t
-
conn
->
ns_conn
->
last_io_time
>
MONGOOSE_USE_WEBSOCKET_PING_INTERVAL
)
{
if
(
t
-
conn
->
ns_conn
->
last_io_time
>
MONGOOSE_USE_WEBSOCKET_PING_INTERVAL
)
{
mg_websocket_write
(
&
conn
->
mg_conn
,
0x9
,
""
,
0
);
mg_websocket_write
(
&
conn
->
mg_conn
,
WEBSOCKET_OPCODE_PING
,
""
,
0
);
}
}
}
}
#else
#else
...
...
mongoose.h
View file @
464b8951
...
@@ -72,6 +72,16 @@ enum mg_event {
...
@@ -72,6 +72,16 @@ enum mg_event {
};
};
typedef
int
(
*
mg_handler_t
)(
struct
mg_connection
*
,
enum
mg_event
);
typedef
int
(
*
mg_handler_t
)(
struct
mg_connection
*
,
enum
mg_event
);
// Websocket opcodes, from http://tools.ietf.org/html/rfc6455
enum
{
WEBSOCKET_OPCODE_CONTINUATION
=
0x0
,
WEBSOCKET_OPCODE_TEXT
=
0x1
,
WEBSOCKET_OPCODE_BINARY
=
0x2
,
WEBSOCKET_OPCODE_CONNECTION_CLOSE
=
0x8
,
WEBSOCKET_OPCODE_PING
=
0x9
,
WEBSOCKET_OPCODE_PONG
=
0xa
};
// Server management functions
// Server management functions
struct
mg_server
*
mg_create_server
(
void
*
server_param
,
mg_handler_t
handler
);
struct
mg_server
*
mg_create_server
(
void
*
server_param
,
mg_handler_t
handler
);
void
mg_destroy_server
(
struct
mg_server
**
);
void
mg_destroy_server
(
struct
mg_server
**
);
...
...
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