diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2014-01-16 16:06:30 +0000 |
---|---|---|
committer | Olivier Crête <olivier.crete@collabora.com> | 2014-01-31 01:49:07 -0500 |
commit | 253be34806bee232df55f2a92609f74a015797da (patch) | |
tree | d87125595c38a584ee7a422d9290245a30dadaab /nice | |
parent | 9661150dcda7939d108e583e7681352f99e581c8 (diff) | |
download | libnice-253be34806bee232df55f2a92609f74a015797da.tar.gz |
agent: Add support for vectored I/O for receives
Add two new public functions:
• nice_agent_recv_messages()
• nice_agent_recv_messages_nonblocking()
which allow receiving multiple messages in a single call, and support
vectors of buffers to receive the messages into.
The existing nice_agent_recv[_nonblocking]() APIs have been left
untouched.
This tidies up a lot of the message handling code internally, and
eliminates a couple of memcpy()s. There are still a few more memcpy()s
on the critical path, which could be eliminated with further work.
In the reliable agent case, every message is memcpy()ed twice: once into
the pseudo-TCP receive buffer, and once out of it. The copy on input
could be eliminated (in the case of in-order delivery of packets) by
receiving directly into the receive buffer. The copy on output can’t be
eliminated except in the I/O callback case (when
nice_agent_attach_recv() has been used), in which case the callback
could be invoked with a pointer directly into the pseudo-TCP receive
buffer.
In the non-reliable agent case, zero memcpy()s are used.
A couple of the more complex socket implementations (TURN and HTTP) have
slow paths during setup, and partially also during normal use. These
could be optimised further, and FIXME comments have been added.
Diffstat (limited to 'nice')
-rw-r--r-- | nice/libnice.sym | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/nice/libnice.sym b/nice/libnice.sym index 92f553f..601afc6 100644 --- a/nice/libnice.sym +++ b/nice/libnice.sym @@ -18,7 +18,9 @@ nice_agent_add_local_address nice_agent_add_stream nice_agent_build_io_stream nice_agent_recv +nice_agent_recv_messages nice_agent_recv_nonblocking +nice_agent_recv_messages_nonblocking nice_agent_attach_recv nice_agent_gather_candidates nice_agent_generate_local_candidate_sdp |