1 /*
2 * Copyright 1999-2006 University of Chicago
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #include "globus_i_service_engine.h"
18
19 /**
20 * Stop accepting new service sessions
21 * @ingroup globus_service_engine
22 *
23 * Stops the engine from accepting any new sessions. Currently active
24 * sessions will continue to be processed.
25 *
26 * @param engine
27 * Engine to stop processing new sessions.
28 *
29 * @retval GLOBUS_SUCCESS
30 * Engine has successfully stopped accepting new sessions.
31 */
32 globus_result_t
33 globus_service_engine_register_stop(
34 globus_service_engine_t engine)
35 10 {
36 10 globus_result_t result = GLOBUS_SUCCESS;
37 GlobusFuncName(globus_service_engine_register_stop);
38 10 GlobusServiceEngineDebugEnter();
39
40 10 GlobusServiceEngineLock(engine);
41 10 engine->stop_sessions = 1;
42 10 globus_xio_server_cancel_accept(engine->server);
43 10 GlobusServiceEngineUnlock(engine);
44
45 10 GlobusServiceEngineDebugExit();
46 10 return result;
47 }