mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-04 18:26:19 +01:00
Update docs on listen backlog
Mention g_socket_set_listen_backlog in g_socket_listen. Explain that listen backlock needs to be set before calling listen. Also verify this with a g_return_if_fail.
This commit is contained in:
parent
69130db81a
commit
bcba61c951
@ -141,6 +141,7 @@ struct _GSocketPrivate
|
|||||||
guint keepalive : 1;
|
guint keepalive : 1;
|
||||||
guint closed : 1;
|
guint closed : 1;
|
||||||
guint connected : 1;
|
guint connected : 1;
|
||||||
|
guint listening : 1;
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
WSAEVENT event;
|
WSAEVENT event;
|
||||||
int current_events;
|
int current_events;
|
||||||
@ -1032,6 +1033,9 @@ g_socket_get_listen_backlog (GSocket *socket)
|
|||||||
* connecting to the socket and the application is not handling them
|
* connecting to the socket and the application is not handling them
|
||||||
* on time then the new connections will be refused.
|
* on time then the new connections will be refused.
|
||||||
*
|
*
|
||||||
|
* Note that this must be called before g_socket_listen() and has no
|
||||||
|
* effect if called after that.
|
||||||
|
*
|
||||||
* Since: 2.22
|
* Since: 2.22
|
||||||
**/
|
**/
|
||||||
void
|
void
|
||||||
@ -1039,6 +1043,7 @@ g_socket_set_listen_backlog (GSocket *socket,
|
|||||||
gint backlog)
|
gint backlog)
|
||||||
{
|
{
|
||||||
g_return_if_fail (G_IS_SOCKET (socket));
|
g_return_if_fail (G_IS_SOCKET (socket));
|
||||||
|
g_return_if_fail (!socket->priv->listening);
|
||||||
|
|
||||||
if (backlog != socket->priv->listen_backlog)
|
if (backlog != socket->priv->listen_backlog)
|
||||||
{
|
{
|
||||||
@ -1240,6 +1245,9 @@ g_socket_is_connected (GSocket *socket)
|
|||||||
* Before calling this the socket must be bound to a local address using
|
* Before calling this the socket must be bound to a local address using
|
||||||
* g_socket_bind().
|
* g_socket_bind().
|
||||||
*
|
*
|
||||||
|
* To set the maximum amount of outstanding clients, use
|
||||||
|
* g_socket_set_listen_backlog().
|
||||||
|
*
|
||||||
* Returns: %TRUE on success, %FALSE on error.
|
* Returns: %TRUE on success, %FALSE on error.
|
||||||
*
|
*
|
||||||
* Since: 2.22
|
* Since: 2.22
|
||||||
@ -1262,6 +1270,8 @@ g_socket_listen (GSocket *socket,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
socket->priv->listening = TRUE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user