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
eb231e64
Commit
eb231e64
authored
Jan 07, 2014
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pseudotcp: Add methods to query the state of the send and recv buffers
parent
fe5dc58b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
0 deletions
+53
-0
agent/pseudotcp.c
agent/pseudotcp.c
+23
-0
agent/pseudotcp.h
agent/pseudotcp.h
+28
-0
docs/reference/libnice/libnice-sections.txt
docs/reference/libnice/libnice-sections.txt
+2
-0
No files found.
agent/pseudotcp.c
View file @
eb231e64
...
@@ -1796,3 +1796,26 @@ resize_receive_buffer (PseudoTcpSocket *self, guint32 new_size)
...
@@ -1796,3 +1796,26 @@ resize_receive_buffer (PseudoTcpSocket *self, guint32 new_size)
priv
->
rcv_wnd
=
available_space
;
priv
->
rcv_wnd
=
available_space
;
}
}
gint
pseudo_tcp_socket_get_available_bytes
(
PseudoTcpSocket
*
self
)
{
PseudoTcpSocketPrivate
*
priv
=
self
->
priv
;
if
(
priv
->
state
!=
TCP_ESTABLISHED
)
{
return
-
1
;
}
return
pseudo_tcp_fifo_get_buffered
(
&
priv
->
rbuf
);
}
gboolean
pseudo_tcp_socket_can_send
(
PseudoTcpSocket
*
self
)
{
PseudoTcpSocketPrivate
*
priv
=
self
->
priv
;
if
(
priv
->
state
!=
TCP_ESTABLISHED
)
{
return
FALSE
;
}
return
(
pseudo_tcp_fifo_get_write_remaining
(
&
priv
->
sbuf
)
!=
0
);
}
agent/pseudotcp.h
View file @
eb231e64
...
@@ -412,6 +412,34 @@ gboolean pseudo_tcp_socket_notify_packet(PseudoTcpSocket *self,
...
@@ -412,6 +412,34 @@ gboolean pseudo_tcp_socket_notify_packet(PseudoTcpSocket *self,
*/
*/
void
pseudo_tcp_set_debug_level
(
PseudoTcpDebugLevel
level
);
void
pseudo_tcp_set_debug_level
(
PseudoTcpDebugLevel
level
);
/**
* pseudo_tcp_socket_get_available_bytes:
* @self: The #PseudoTcpSocket object.
*
* Gets the number of bytes of data in the buffer that can be read without
* receiving more packets from the network.
*
* Returns: The number of bytes or -1 if the connection is not established
*
* Since: 0.1.5
*/
gint
pseudo_tcp_socket_get_available_bytes
(
PseudoTcpSocket
*
self
);
/**
* pseudo_tcp_socket_can_send:
* @self: The #PseudoTcpSocket object.
*
* Returns if there is space in the send buffer to send any data.
*
* Returns: %TRUE if data can be sent, %FALSE otherwise
*
* Since: 0.1.5
*/
gboolean
pseudo_tcp_socket_can_send
(
PseudoTcpSocket
*
self
);
G_END_DECLS
G_END_DECLS
#endif
/* _PSEUDOTCP_H */
#endif
/* _PSEUDOTCP_H */
...
...
docs/reference/libnice/libnice-sections.txt
View file @
eb231e64
...
@@ -255,4 +255,6 @@ pseudo_tcp_socket_notify_clock
...
@@ -255,4 +255,6 @@ pseudo_tcp_socket_notify_clock
pseudo_tcp_socket_notify_mtu
pseudo_tcp_socket_notify_mtu
pseudo_tcp_socket_notify_packet
pseudo_tcp_socket_notify_packet
pseudo_tcp_set_debug_level
pseudo_tcp_set_debug_level
pseudo_tcp_socket_get_available_bytes
pseudo_tcp_socket_can_send
</SECTION>
</SECTION>
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