CEF IPC vs. Single app instance

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CEF IPC vs. Single app instance

Postby Peter » Thu Jun 11, 2020 5:17 am

Hello all,

Can I use the IPC we have in CEF to make sure that only one instance of my app is running?

I started reading the docs, and it seems to me that I have to create a browser instance to send and receive messages, is that correct?

What I want to do is to make the 'new' instance(s) quit, but tell the 'old' instance to open another browser window.
Peter
Techie
 
Posts: 38
Joined: Thu Mar 05, 2020 9:41 am

Re: CEF IPC vs. Single app instance

Postby amaitland » Thu Jun 11, 2020 5:34 am

No, the IPC is for communicating between the browser process and the render processes.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am

Re: CEF IPC vs. Single app instance

Postby Peter » Thu Jun 11, 2020 8:32 am

But this means that there is a way for these processes to find each other, so we might be able to find the already-launched instance?
Peter
Techie
 
Posts: 38
Joined: Thu Mar 05, 2020 9:41 am

Re: CEF IPC vs. Single app instance

Postby magreenblatt » Thu Jun 11, 2020 9:16 am

There are standard platform ways to guarantee a single app instance. Google “single app instance” + your platform.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: CEF IPC vs. Single app instance

Postby Peter » Mon Jun 15, 2020 11:45 am

magreenblatt wrote:There are standard platform ways to guarantee a single app instance. Google “single app instance” + your platform.

Well, of course I was hoping to get it "for free" and cross-platform, if CEF would allow it :)

I've looked around for GTK-based solution, and found a problem here: with GApplication, for the whole unique thing to work we are calling g_application_run(), that runs its own event loop - but I also need to run CEF event loop, any advice?
Peter
Techie
 
Posts: 38
Joined: Thu Mar 05, 2020 9:41 am

Re: CEF IPC vs. Single app instance

Postby magreenblatt » Mon Jun 15, 2020 12:12 pm

There are several generic approaches on Linux, like https://stackoverflow.com/questions/220 ... 542#220542
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 67 guests