[Libreoffice] URE bootstrap - error establishing connection ?

Stephan Bergmann sbergman at redhat.com
Mon Nov 21 00:14:10 PST 2011


On 11/18/2011 08:51 PM, Christian Ehrlicher wrote:
> When I try to connect to libreoffice over a uno socket
> (com.sun.star.bridge.UnoUrlResolver) in most cases I need to try at least two
> times because the socket is not (yet) open:
>
> Cannot establish a connection using
> 'uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager': Connector
> : couldn't connect to socket (Erfolg)
>
> At least this is what I would interpret into this error message. Is this
> correct? Then the solution would be to wait a little bit longer until I try to
> connect to libreoffice if this helps...

Yes, there is of course a race between soffice starting to listen on the 
socket you passed it with the -accept argument and your code calling 
connect.  See, for example, the for -- try -- catch NoConnectException 
loop in unotest/source/cpp/officeconnection.cxx for how to live with 
that race.

> Now the document loader example mentions another uno mechanism:
>
> NOTE: This example does not use the new UNO bootstrap mechanism, it uses still
> a socket connection.
>
> Does this mean the socket connection is deprecated? And if so - what's the new
> way and can someone give me an example? :-)

That note is misleading.  The simplified bootstrap mechanism internally 
still uses a socket connection.  See 
<http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/ProUNO/C%2B%2B/Transparent_Use_of_Office_UNO_Components>.

Stephan


More information about the LibreOffice mailing list