question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Server still running after calling client.stop()?

See original GitHub issue

I’ve got the following code in my extension

	// create language client and launch server
	const pythonMain = context.asAbsolutePath(
		path.join('src', 'server', 'main.py')
	);
	const args = [pythonMain];
	// Add debug options here if needed
	const serverOptions: ServerOptions = { command: pythonInterpreter, args };
	const clientOptions: LanguageClientOptions = {
		documentSelector: [
			{ scheme: "file", language: "antimony" },
		],
	};
	// Create the language client and start the client.
	client = new LanguageClient(
		'AntimonyLanguage',
		'Antimony Language Server',
		serverOptions,
		clientOptions
	);
	// Start the client. This will also launch the server
	const clientDisposable = client.start();
	context.subscriptions.push(clientDisposable);

and

export function deactivate(): Thenable<void> | undefined {
	if (!client) {
		return undefined;
	}
	// shut down the language client
	return client.stop();
}

I’ve noticed that when I run my extension in debugging mode, even after I quit the extension I can still see the python process in my task manager, and if I run my extension 10 times, there will be 10 processes. Am I doing anything wrong?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dbaeumercommented, Dec 10, 2021

@vain0x this got already addressed in the latest next versions of the library: capture

Server: 8.0.0-next.5 and client: 8.0.0-next.7

0reactions
dbaeumercommented, Dec 13, 2021

@mastevb will close the issue. Please ping if you have additional information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why the server stops running when I close the Client?
This means that after your client socket is accepted, it will exit because there is no flow control element that will have it...
Read more >
What does client.stop() do and how does if(client) work from ...
When the server code is finished sending packets, it should call client.stop() to send the disconnect message. You must empty the client socket ......
Read more >
Services overview | Android Developers
A Service is an application component that can perform long-running operations in the background. It does not provide a user interface.
Read more >
Understanding and Handling Connection Lifetime Events in ...
If the client calls the Stop method, a stop message is sent to the server, and both client and server end the SignalR...
Read more >
Paho Python MQTT Client-Understanding The Loop
To stop the loop use the loop_stop() method. The loop_forever() method blocks the program, and is useful when the program must run ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found