1 // vim: noet sw=4 ts=4:
3 ==================================================================================
4 Copyright (c) 2020 Nokia
5 Copyright (c) 2020 AT&T Intellectual Property.
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18 ==================================================================================
22 ******************************************************************************
24 * Mnemonic: SIshutdown
25 * Abstract: Shutdown and abort functions.
28 * Author: E. Scott Daniels
30 *****************************************************************************
32 #include "sisetup.h" // get includes and defines
36 static void sishutdown( struct ginfo_blk *gptr, int flags ) {
39 if( gptr != NULL && gptr->magicnum == MAGICNUM )
41 gptr->flags |= GIF_SHUTDOWN; // signal shutdown
42 for( tpb = gptr->tplist; tpb != NULL; tpb = tpb->next )
44 tpb->flags |= (TPF_UNBIND | flags); // force unbind on session and set caller flags
45 SIterm( gptr, tpb ); // term marks ok to delete but does NOT remove it
51 Run the list of known transport sessions and close them gracefully. This
52 will result in time-waits which might prevent the application from
53 restarting immediately as the listen port(s) might not be usable.
55 extern void SIshutdown( struct ginfo_blk *gptr ) {
56 sishutdown( gptr, 0 );
60 Run the list of known transport sessions and close them by aborting
61 (resetting the connection). This can result in buffered, but untransmitted,
62 data from being lost; the risk should be known by the caller.
64 extern void SIabort( struct ginfo_blk *gptr ) {
65 sishutdown( gptr, TPF_ABORT );