Sends a shutdown signal to the unity environment, and closes the grpc connection.
9385
def close(self):
        
        if self.is_open:
            message_input = UnityMessage()
            message_input.header.status = 400
            self.unity_to_external.parent_conn.send(message_input)
            self.unity_to_external.parent_conn.close()
            self.server.stop(False)
            self.is_open = False
57201
async def shutdown(self, force = False, connmark = -1):
        '''
        
        '''
        if connmark is None:
            connmark = self.connmark
        self.scheduler.emergesend(ConnectionControlEvent(self, ConnectionControlEvent.SHUTDOWN, force, connmark))
729139
def kill_process(process):
    """"""
    logger = logging.getLogger('xenon')
    logger.info('Terminating Xenon-GRPC server.')
    os.kill(process.pid, signal.SIGINT)
    process.wait()
433037
def shutdown_rd(self):
        
        if self._sock_send is not None:
            self.sock.close()
        else:
            return self.shutdown(socket.SHUT_RD)
124605
def stop(self, dummy_signum=None, dummy_frame=None):
        
        logging.info('Shutting down ...')
        self.socket.close()
        sys.exit(0)
471999
def shutdown(self):
        """"""

        if self.verbose:
            print(self.socket.getsockname(), 'xx', self.peername)

        try:
            self.socket.shutdown(socket.SHUT_RDWR)
        except IOError as err:
            assert err.errno is _ENOTCONN, "unexpected IOError: %s" % err
            # remote peer has already closed the connection,
            # just ignore the exceeption
            pass
604945
private void shutdown() {
        try {
            this.facade.stop();
            this.facade = null;
            // Destroy the static reference
            destroyInstance();
        } catch (final CoreException e) {
            LOGGER.log(SHUTDOWN_ERROR, e);
        }
    }
1301109
@Override
    protected void shutDown() throws Exception {
        long traceId = LoggerHelpers.traceEnterWithContext(log, this.objectId, "shutDown");
        try {
            log.info("Stopping gRPC server listening on port: {}", this.config.getPort());
            this.server.shutdown();
            log.info("Awaiting termination of gRPC server");
            this.server.awaitTermination();
            log.info("gRPC server terminated");
        } finally {
            LoggerHelpers.traceLeave(log, this.objectId, "shutDown", traceId);
        }
    }
871336
public function close()
    {
        foreach ($this->clients as &$client) {
            $this->disconnect($client, 'Receiver shutting down... Goodbye.');
        }

        socket_close($this->socket);
    }
500512
public void shutDown() {
    logger.info("Shutting down RPC server.");
    channel.close().addListener(new GenericFutureListener<Future<Void>>() {

      @Override
      public void operationComplete(Future<Void> future) throws Exception {
        parentGroup.shutdownGracefully();
        childGroup.shutdownGracefully();
      }
    }).awaitUninterruptibly();
  }
408866
def close(self):
        
        if self._socket:
            if USE_STDLIB_SSL:
                # NB: Python 2.7.8 and earlier does not have a compatible
                # shutdown() method due to the SSL lib
                try:
                    self._socket.shutdown(socket.SHUT_RDWR)
                except EnvironmentError:
                    # NB: sometimes these exceptions are raised if the initial
                    # connection didn't succeed correctly, or if shutdown() is
                    # called after the connection dies
                    logging.debug('Exception occurred while shutting '
                                  'down socket.', exc_info=True)
            self._socket.close()
            del self._socket
168302
function close()
    {
        if(!$this->socket) {
            return;
        }

        $this->sendDisconnect();
        stream_socket_shutdown($this->socket, STREAM_SHUT_RDWR);
        $this->socket = null;
    }
1336172
public void shutdown() throws IOException {
    // Clean up RPC connections.
    Iterator <ClientDatanodeProtocol> connections =
      datanodeMap.values().iterator();
    while(connections.hasNext()) {
      ClientDatanodeProtocol cnxn = connections.next();
      RPC.stopProxy(cnxn);
    }
    datanodeMap.clear();
    executor.shutdownNow();
    synchronized (leaseCheckers) {
      for (LeaseChecker checker : leaseCheckers.values()) {
        checker.closeRenewal();
      }
    }
  }
1227254
def close(self):
        

        if self._recv_thread:
            self._recv_thread.kill()
            self._recv_thread = None

        if self._send_thread:
            self._send_thread.kill()
            self._send_thread = None

        if self._sock:
            self._sock.close()
            self._sock = None

        # Make sure to notify the manager we're closed
        super(TCPTendril, self).close()
1074824
public static void shutdown(GSSCredential cred, GlobusURL gassURL)
	throws IOException, GSSException {

	OutputStream output     = null;
	InputStream input       = null;
	Socket socket           = null;

	try {

	    if (gassURL.getProtocol().equalsIgnoreCase("https")) {

		GSSManager manager = ExtendedGSSManager.getInstance();

		ExtendedGSSContext context =
		    (ExtendedGSSContext)manager.createContext(null,
							      GSSConstants.MECH_OID,
							      cred,
							      GSSContext.DEFAULT_LIFETIME);

		context.setOption(GSSConstants.GSS_MODE,
				  GSIConstants.MODE_SSL);

		GssSocketFactory factory = GssSocketFactory.getDefault();

		socket = factory.createSocket(gassURL.getHost(),
					      gassURL.getPort(),
					      context);

		((GssSocket)socket).setAuthorization(SelfAuthorization.getInstance());
	    } else {
                SocketFactory factory = SocketFactory.getDefault();
		socket = factory.createSocket(gassURL.getHost(),
                                              gassURL.getPort());
	    }

	    output = socket.getOutputStream();
	    input  = socket.getInputStream();

	    String msg =  GASSProtocol.SHUTDOWN(SHUTDOWN_STR,
						gassURL.getHost());


            if (logger.isTraceEnabled()) {
                logger.trace("Shutdown msg: " + msg);
            }

	    output.write( msg.getBytes() );
	    output.flush();

	    HttpResponse rp = new HttpResponse(input);
	    if (rp.httpCode == -1 && rp.httpMsg == null) {
		/* this is a workaround for C gass-server.
		 * The server just shuts down - it does
		 * not send the reply */
	    } else if (rp.httpCode != 200) {
		throw new IOException("Remote shutdown failed (" + rp.httpCode + " " + rp.httpMsg + ")");
	    }

	} finally {
	    try {
		if (output != null) output.close();
		if (input != null) input.close();
		if (socket != null) socket.close();
	    } catch(Exception e) {}
	}
    }
590244
public void shutdown() {
    this.flowTriggerExecutorService.shutdown();
    this.cancelExecutorService.shutdown();
    this.timeoutService.shutdown();

    this.flowTriggerExecutorService.shutdownNow();
    this.cancelExecutorService.shutdownNow();
    this.timeoutService.shutdownNow();

    this.triggerProcessor.shutdown();
    this.triggerPluginManager.shutdown();
    this.cleaner.shutdown();
  }
1147902
def close(self):
        """"""

        try:
            self.sock.shutdown(socket.SHUT_RDWR)
            self.sock.close()
        except socket.error:
            pass