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
596e4f4b
Commit
596e4f4b
authored
Apr 11, 2014
by
Youness Alaoui
Committed by
Olivier Crête
May 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a nice_socket_recv convenience function similar to nice_socket_send
parent
a9ce3510
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
socket/socket.c
socket/socket.c
+17
-0
socket/socket.h
socket/socket.h
+4
-1
No files found.
socket/socket.c
View file @
596e4f4b
...
@@ -195,6 +195,23 @@ nice_socket_send_messages_reliable (NiceSocket *sock, const NiceAddress *to,
...
@@ -195,6 +195,23 @@ nice_socket_send_messages_reliable (NiceSocket *sock, const NiceAddress *to,
return
sock
->
send_messages_reliable
(
sock
,
to
,
messages
,
n_messages
);
return
sock
->
send_messages_reliable
(
sock
,
to
,
messages
,
n_messages
);
}
}
/* Convenience wrapper around nice_socket_recv_messages(). Returns the number of
* bytes received on success (which will be @len), zero if sending would block, or
* -1 on error. */
gssize
nice_socket_recv
(
NiceSocket
*
sock
,
NiceAddress
*
from
,
gsize
len
,
gchar
*
buf
)
{
GInputVector
local_buf
=
{
buf
,
len
};
NiceInputMessage
local_message
=
{
&
local_buf
,
1
,
from
,
0
};
gint
ret
;
ret
=
sock
->
recv_messages
(
sock
,
&
local_message
,
1
);
if
(
ret
==
1
)
return
local_message
.
length
;
return
ret
;
}
/* Convenience wrapper around nice_socket_send_messages(). Returns the number of
/* Convenience wrapper around nice_socket_send_messages(). Returns the number of
* bytes sent on success (which will be @len), zero if sending would block, or
* bytes sent on success (which will be @len), zero if sending would block, or
* -1 on error. */
* -1 on error. */
...
...
socket/socket.h
View file @
596e4f4b
...
@@ -99,7 +99,10 @@ gint
...
@@ -99,7 +99,10 @@ gint
nice_socket_send_messages_reliable
(
NiceSocket
*
sock
,
const
NiceAddress
*
addr
,
nice_socket_send_messages_reliable
(
NiceSocket
*
sock
,
const
NiceAddress
*
addr
,
const
NiceOutputMessage
*
messages
,
guint
n_messages
);
const
NiceOutputMessage
*
messages
,
guint
n_messages
);
gssize
gssize
nice_socket_send
(
NiceSocket
*
sock
,
const
NiceAddress
*
addr
,
gsize
len
,
nice_socket_recv
(
NiceSocket
*
sock
,
NiceAddress
*
from
,
gsize
len
,
gchar
*
buf
);
gssize
nice_socket_send
(
NiceSocket
*
sock
,
const
NiceAddress
*
to
,
gsize
len
,
const
gchar
*
buf
);
const
gchar
*
buf
);
gssize
gssize
nice_socket_send_reliable
(
NiceSocket
*
sock
,
const
NiceAddress
*
addr
,
gsize
len
,
nice_socket_send_reliable
(
NiceSocket
*
sock
,
const
NiceAddress
*
addr
,
gsize
len
,
...
...
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