/* dsa_wait.c - accept and process events listened for */
static char *rcsid
= "$Header: /f/osi/quipu/RCS/dsa_wait.c,v 7.6 91/02/22 09:39:12 mrose Interim $";
* $Header: /f/osi/quipu/RCS/dsa_wait.c,v 7.6 91/02/22 09:39:12 mrose Interim $
* Revision 7.6 91/02/22 09:39:12 mrose
* Revision 7.5 90/10/17 11:54:09 mrose
* Revision 7.4 90/07/09 14:46:03 mrose
* Revision 7.3 90/04/18 08:49:51 mrose
* Revision 7.2 90/03/15 11:19:00 mrose
* Revision 7.1 89/12/19 16:20:30 mrose
* Revision 7.0 89/11/23 22:17:25 mrose
* Acquisition, use, and distribution of this module and related
* materials are subject to the restrictions of a license agreement.
* Consult the Preface in the User's Manual for the full terms of
#include "quipu/connection.h"
extern unsigned watchdog_time
;
extern unsigned watchdog_delta
;
struct TSAPdisconnect td_s
;
struct TSAPdisconnect
*td
= &td_s
;
struct connection
* next_cn
;
DLOG(log_dsap, LLOG_DEBUG, ("dsa_wait connections:"));
for(cn
=connlist
; cn
!= NULLCONN
; cn
=cn
->cn_next
)
if (cn
->cn_state
== CN_CONNECTING1
)
FD_SET(cn
->cn_ad
, &wads
);
SLOG (tsap_log
, LLOG_EXCEPTIONS
, NULLCP
,
("fd=%d for connection block(1)", cn
-> cn_ad
));
(void) sprintf(wbp
, ", %d.", cn
->cn_ad
);
wbp
+= (strlen(wbp
) - 1);
FD_SET(cn
->cn_ad
, &iads
);
SLOG (tsap_log
, LLOG_EXCEPTIONS
, NULLCP
,
("fd=%d for connection block(2)", cn
-> cn_ad
));
(void) sprintf(ibp
, ", %d.", cn
->cn_ad
);
ibp
+= (strlen(ibp
) - 1);
DLOG (log_dsap
, LLOG_DEBUG
, ("Listening for new associations"));
LLOG (log_dsap
, LLOG_NOTICE
, ("Listening on ads: %s", (ibuffer
+1)));
DLOG (log_dsap
, LLOG_DEBUG
, ("Not making new associations"));
LLOG (log_dsap
, LLOG_NOTICE
, ("Making ads: %s", (wbuffer
+1)));
DLOG (log_dsap
, LLOG_NOTICE
, ("secs: %d; nads: %d; iads 0x%x, wads 0x%x",
secs
, nads
, iads
.fds_bits
[0], wads
.fds_bits
[0]));
/* if secs == NOTOK we want to block, otherwise set watchdog, but
beware of setting watchdog off accidentally !
if (secs
> (watchdog_time
- watchdog_delta
))
watch_dog_aux ("TNetAccept (long)",(unsigned)secs
+ watchdog_delta
);
watch_dog ("TNetAccept");
if(TNetAcceptAux(&vecp
, vec
, &newfd
, NULLTA
, nads
, &iads
, &wads
, NULLFD
, secs
, td
) == NOTOK
)
td_log (td
, "TNetAccept");
* if (td -> td_reason == DR_PROTOCOL || td -> td_reason == DR_NETWORK)
* attempt_restart (NOTOK);
* exit (0); */ /* should not be reached */
conn_pre_init (newfd
,vecp
,vec
);
for(cn
= connlist
; cn
!= NULLCONN
; cn
= next_cn
)
DLOG(log_dsap
, LLOG_TRACE
, ("Checking %d", cn
->cn_ad
));
if(FD_ISSET(cn
->cn_ad
, &wads
))
DLOG(log_dsap
, LLOG_DEBUG
, ("Polling %d", cn
->cn_ad
));
DLOG (log_dsap
, LLOG_TRACE
, ("Checking %d (2)", cn
->cn_ad
));
if (FD_ISSET(cn
->cn_ad
, &iads
))
DLOG(log_dsap
, LLOG_DEBUG
, ("Polling %d (2)", cn
->cn_ad
));
if (FD_ISSET (cn
->cn_ad
, &iads
))
DLOG (log_dsap
,LLOG_DEBUG
,( "Activity on association: %d", cn
->cn_ad
));
} /* if there is work on this connection */
if (FD_ISSET (cn
->cn_ad
, &iads
))
(void) conn_release_retry(cn
);
if (FD_ISSET (cn
->cn_ad
, &iads
))
if (FD_ISSET (cn
->cn_ad
, &iads
))
if(cn
->cn_start
.cs_bind_compare
== NULLOPER
)
LLOG(log_dsap
, LLOG_EXCEPTIONS
, ("cn_state = INDICATED but no bind_compare operation"));
cn
->cn_start
.cs_bind_compare
->on_bind_compare
= NULLCONN
;
if (FD_ISSET (cn
->cn_ad
, &iads
))
LLOG (log_dsap
,LLOG_EXCEPTIONS
,( "Unexpected activity on association %d ... aborting",cn
->cn_ad
));
} /* if there is work on this connection */
} /* for each connection */