Commit c70bc9fc authored by Philip Withnall's avatar Philip Withnall Committed by Olivier Crête
Browse files

pseudotcp: Add pseudo_tcp_socket_is_closed()

New convenience API to check if the socket is in state TCP_CLOSED.
parent b6550e04
......@@ -1958,3 +1958,11 @@ set_state (PseudoTcpSocket *self, PseudoTcpState new_state)
priv->state = new_state;
}
gboolean
pseudo_tcp_socket_is_closed (PseudoTcpSocket *self)
{
PseudoTcpSocketPrivate *priv = self->priv;
return (priv->state == TCP_CLOSED);
}
......@@ -471,6 +471,18 @@ gboolean pseudo_tcp_socket_can_send (PseudoTcpSocket *self);
*/
gsize pseudo_tcp_socket_get_available_send_space (PseudoTcpSocket *self);
/**
* pseudo_tcp_socket_is_closed:
* @self: The #PseudoTcpSocket object.
*
* Gets whether the socket is closed, with the shutdown handshake completed,
* and both peers no longer able to read or write data to the connection.
*
* Returns: %TRUE if the socket is closed in both directions, %FALSE otherwise
* Since: UNRELEASED
*/
gboolean pseudo_tcp_socket_is_closed (PseudoTcpSocket *self);
G_END_DECLS
#endif /* _PSEUDOTCP_H */
......
......@@ -291,6 +291,7 @@ pseudo_tcp_socket_connect
pseudo_tcp_socket_recv
pseudo_tcp_socket_send
pseudo_tcp_socket_close
pseudo_tcp_socket_is_closed
pseudo_tcp_socket_get_error
pseudo_tcp_socket_get_next_clock
pseudo_tcp_socket_notify_clock
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment