Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
libnice
libnice
Commits
818427d0
Commit
818427d0
authored
Feb 04, 2013
by
Youness Alaoui
Browse files
example: Exit on Ctrl-D and send EOS signal to the other end
parent
bcd83b68
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/simple-example.c
View file @
818427d0
...
...
@@ -252,6 +252,10 @@ stdin_send_data_cb (GIOChannel *source, GIOCondition cond,
g_free
(
line
);
printf
(
"> "
);
fflush
(
stdout
);
}
else
{
nice_agent_send
(
agent
,
stream_id
,
1
,
1
,
"
\0
"
);
// Ctrl-D was pressed.
g_main_loop_quit
(
gloop
);
}
return
TRUE
;
...
...
@@ -269,6 +273,8 @@ static void
cb_nice_recv
(
NiceAgent
*
agent
,
guint
stream_id
,
guint
component_id
,
guint
len
,
gchar
*
buf
,
gpointer
data
)
{
if
(
len
==
1
&&
buf
[
0
]
==
'\0'
)
g_main_loop_quit
(
gloop
);
printf
(
"%.*s"
,
len
,
buf
);
fflush
(
stdout
);
}
...
...
Write
Preview
Supports
Markdown
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