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
aa301c19
Commit
aa301c19
authored
Feb 01, 2007
by
Dafydd Harries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor nice_agent_recv
darcs-hash:20070201180813-c9803-6f9c7991e1f1e0f7a69b69dcb0b59c73f6b31f27.gz
parent
dfb1d6de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
23 deletions
+32
-23
agent/agent.c
agent/agent.c
+32
-23
No files found.
agent/agent.c
View file @
aa301c19
...
...
@@ -533,35 +533,15 @@ ERROR:
*/
}
/**
* nice_agent_recv:
* @agent: The agent to notify
* @candidate_id: The ID of the candidate that has data waiting on its socket
*
* Tell the agent to try receiving a packet on @candidate's socket. This is
* useful for integrating the agent into a select()-loop. This function will
* block if the socket is blocking.
**/
void
nice_agent_recv
(
static
void
_nice_agent_recv
(
NiceAgent
*
agent
,
guint
candidate_id
)
NiceCandidate
*
candidate
)
{
NiceCandidate
*
candidate
;
guint
len
;
gchar
buf
[
1024
];
struct
sockaddr_in
from
;
/* XXX: this is a probably a good place to start optimizing, as it gets
* called once for each packet recieved
*/
candidate
=
_local_candidate_lookup
(
agent
,
candidate_id
);
if
(
candidate
==
NULL
)
return
;
len
=
udp_socket_recv
(
&
(
candidate
->
sock
),
&
from
,
sizeof
(
buf
)
/
sizeof
(
gchar
),
buf
);
g_assert
(
len
>
0
);
...
...
@@ -627,6 +607,35 @@ nice_agent_recv (
}
/**
* nice_agent_recv:
* @agent: The agent to notify
* @candidate_id: The ID of the candidate that has data waiting on its socket
*
* Tell the agent to try receiving a packet on @candidate's socket. This is
* useful for integrating the agent into a select()-loop. This function will
* block if the socket is blocking.
**/
void
nice_agent_recv
(
NiceAgent
*
agent
,
guint
candidate_id
)
{
NiceCandidate
*
candidate
;
/* XXX: this is a probably a good place to start optimizing, as it gets
* called once for each packet recieved
*/
candidate
=
_local_candidate_lookup
(
agent
,
candidate_id
);
if
(
candidate
==
NULL
)
return
;
_nice_agent_recv
(
agent
,
candidate
);
}
/**
* Set the STUN server from which to obtain server-reflexive candidates.
*/
...
...
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