diff options
author | Youness Alaoui <youness.alaoui@collabora.co.uk> | 2014-04-05 00:29:54 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@ocrete.ca> | 2014-05-15 09:39:34 -0400 |
commit | 535701b0094218d162ac26820d1613ccb6ee1727 (patch) | |
tree | f6a85508778be838c09e27f4031fd0808d1a2e61 /socket/socket.h | |
parent | 06cb5a12ff02a5a857b2c0ebd007bd35f80b5f55 (diff) | |
download | libnice-535701b0094218d162ac26820d1613ccb6ee1727.tar.gz |
Add a nice_socket_send_reliable API for internal use.
One issue with tcp-bsd is that it will queue messages when the tcp socket
is not writable, but it will also drop messages when the queue is full.
If we want to do proper reliable ice-tcp, we need to make sure that
messages don't get dropped, also, this would affect http/socks5/pseudossl
if their messages get dropped. For ice-tcp, when the socket is not writable
we want to return 0, not queue the message.
The change here is to allow connchecks and other important protocol messages
to be sent as 'reliable' on tcp transports by queuing them and in the various
socket layers and to never drop them, but all user messages will be dropped.
if the tcp socket is not writable.
Diffstat (limited to 'socket/socket.h')
-rw-r--r-- | socket/socket.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/socket/socket.h b/socket/socket.h index 18e5fb5..e6eb27e 100644 --- a/socket/socket.h +++ b/socket/socket.h @@ -80,6 +80,8 @@ struct _NiceSocket /* As above, @n_messages may be zero. Iff so, @messages may be %NULL. */ gint (*send_messages) (NiceSocket *sock, const NiceAddress *to, const NiceOutputMessage *messages, guint n_messages); + gint (*send_messages_reliable) (NiceSocket *sock, const NiceAddress *to, + const NiceOutputMessage *messages, guint n_messages); gboolean (*is_reliable) (NiceSocket *sock); void (*close) (NiceSocket *sock); void *priv; @@ -93,9 +95,15 @@ nice_socket_recv_messages (NiceSocket *sock, gint nice_socket_send_messages (NiceSocket *sock, const NiceAddress *addr, const NiceOutputMessage *messages, guint n_messages); +gint +nice_socket_send_messages_reliable (NiceSocket *sock, const NiceAddress *addr, + const NiceOutputMessage *messages, guint n_messages); gssize nice_socket_send (NiceSocket *sock, const NiceAddress *addr, gsize len, const gchar *buf); +gssize +nice_socket_send_reliable (NiceSocket *sock, const NiceAddress *addr, gsize len, + const gchar *buf); gboolean nice_socket_is_reliable (NiceSocket *sock); |