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
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.