From 50f67f1c3ae5bb8e42fe839e6a6a9cb813a90c53 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Mon, 29 Aug 2005 09:41:21 +0000 Subject: Revery previous change. Was intended for ams-branch, not HEAD. --- pflocal/connq.h | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'pflocal/connq.h') diff --git a/pflocal/connq.h b/pflocal/connq.h index 17c88c0b..1039bff9 100644 --- a/pflocal/connq.h +++ b/pflocal/connq.h @@ -1,6 +1,6 @@ /* Connection queues - Copyright (C) 1995, 2005 Free Software Foundation, Inc. + Copyright (C) 1995 Free Software Foundation, Inc. Written by Miles Bader @@ -23,8 +23,9 @@ #include -/* Forward. */ +/* Unknown types */ struct connq; +struct connq_request; struct sock; /* Create a new listening queue, returning it in CQ. The resulting queue @@ -35,26 +36,26 @@ error_t connq_create (struct connq **cq); /* Destroy a queue. */ void connq_destroy (struct connq *cq); -/* Return a connection request on CQ. If SOCK is NULL, the request is - left in the queue. If NOBLOCK is true, EWOULDBLOCK is returned - when there are no immediate connections available. */ -error_t connq_listen (struct connq *cq, int noblock, struct sock **sock); +/* Wait for a connection attempt to be made on CQ, and return the connecting + socket in SOCK, and a request tag in REQ. If REQ is NULL, the request is + left in the queue, otherwise connq_request_complete must be called on REQ + to allow the requesting thread to continue. If NOBLOCK is true, + EWOULDBLOCK is returned when there are no immediate connections + available. CQ should be unlocked. */ +error_t connq_listen (struct connq *cq, int noblock, + struct connq_request **req, struct sock **sock); -/* Try to connect SOCK with the socket listening on CQ. If NOBLOCK is - true, then return EWOULDBLOCK if there are no connections - immediately available. On success, this call must be followed up - either connq_connect_complete or connq_connect_cancel. */ -error_t connq_connect (struct connq *cq, int noblock); - -/* Follow up to connq_connect. Completes the connection, SOCK is the - new server socket. */ -void connq_connect_complete (struct connq *cq, struct sock *sock); - -/* Follow up to connq_connect. Cancel the connect. */ -void connq_connect_cancel (struct connq *cq); +/* Return the error code ERR to the thread that made the listen request REQ, + returned from a previous connq_listen. */ +void connq_request_complete (struct connq_request *req, error_t err); /* Set CQ's queue length to LENGTH. Any sockets already waiting for a - connections that are past the new length remain. */ + connections that are past the new length will fail with ECONNREFUSED. */ error_t connq_set_length (struct connq *cq, int length); +/* Try to connect SOCK with the socket listening on CQ. If NOBLOCK is true, + then return EWOULDBLOCK immediately when there are no immediate + connections available. Neither SOCK nor CQ should be locked. */ +error_t connq_connect (struct connq *cq, int noblock, struct sock *sock); + #endif /* __CONNQ_H__ */ -- cgit v1.2.3