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

pseudotcp: Add pseudo_tcp_socket_is_closed_remotely()

New convenience API to check if the remote end of a pseudo-TCP socket
has been closed (but not necessarily the local end). This is currently a
stub implementation, but will be used fully once pseudo-TCP FIN–ACK
support lands.
parent c70bc9fc
......@@ -1966,3 +1966,9 @@ pseudo_tcp_socket_is_closed (PseudoTcpSocket *self)
return (priv->state == TCP_CLOSED);
pseudo_tcp_socket_is_closed_remotely (PseudoTcpSocket *self)
return pseudo_tcp_socket_is_closed (self);
......@@ -483,6 +483,22 @@ gsize pseudo_tcp_socket_get_available_send_space (PseudoTcpSocket *self);
gboolean pseudo_tcp_socket_is_closed (PseudoTcpSocket *self);
* pseudo_tcp_socket_is_closed_remotely:
* @self: The #PseudoTcpSocket object.
* Gets whether the socket has been closed on the remote peer’s side of the
* connection (i.e. whether pseudo_tcp_socket_close() has been called there).
* This is guaranteed to return %TRUE if pseudo_tcp_socket_is_closed() returns
* %TRUE. It will not return %TRUE after pseudo_tcp_socket_close() is called
* until a FIN segment is received from the remote peer.
* Returns: %TRUE if the remote peer has closed its side of the connection,
* %FALSE otherwise
gboolean pseudo_tcp_socket_is_closed_remotely (PseudoTcpSocket *self);
#endif /* _PSEUDOTCP_H */
Supports Markdown
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