Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
818427d0
Commit
818427d0
authored
Feb 04, 2013
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
example: Exit on Ctrl-D and send EOS signal to the other end
parent
bcd83b68
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
examples/simple-example.c
examples/simple-example.c
+6
-0
No files found.
examples/simple-example.c
View file @
818427d0
...
@@ -252,6 +252,10 @@ stdin_send_data_cb (GIOChannel *source, GIOCondition cond,
...
@@ -252,6 +252,10 @@ stdin_send_data_cb (GIOChannel *source, GIOCondition cond,
g_free
(
line
);
g_free
(
line
);
printf
(
"> "
);
printf
(
"> "
);
fflush
(
stdout
);
fflush
(
stdout
);
}
else
{
nice_agent_send
(
agent
,
stream_id
,
1
,
1
,
"
\0
"
);
// Ctrl-D was pressed.
g_main_loop_quit
(
gloop
);
}
}
return
TRUE
;
return
TRUE
;
...
@@ -269,6 +273,8 @@ static void
...
@@ -269,6 +273,8 @@ static void
cb_nice_recv
(
NiceAgent
*
agent
,
guint
stream_id
,
guint
component_id
,
cb_nice_recv
(
NiceAgent
*
agent
,
guint
stream_id
,
guint
component_id
,
guint
len
,
gchar
*
buf
,
gpointer
data
)
guint
len
,
gchar
*
buf
,
gpointer
data
)
{
{
if
(
len
==
1
&&
buf
[
0
]
==
'\0'
)
g_main_loop_quit
(
gloop
);
printf
(
"%.*s"
,
len
,
buf
);
printf
(
"%.*s"
,
len
,
buf
);
fflush
(
stdout
);
fflush
(
stdout
);
}
}
...
...
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