[libreoffice-dev] - libreoffice 4.0 - waiting on multiple sockets
Stephan Bergmann
sbergman at redhat.com
Mon Jan 28 04:06:54 PST 2013
On 01/26/2013 12:01 AM, Rai, Neeraj wrote:
> I have an extension that is communicating with a a standalone shared lib
> running via uno exe. I start a background thread in scalc and use
> osl::socket (client/server) to pass data.
In general, I would not recommend to create an own communication
protocol there. As both processes are apparently able to speak UNO, you
can use that for remote communication.
On the uno exe side, you would need to invent some new UNO service that
is running there and listening on a specific connection (you run the uno
exe as "uno -s XXX -u uno:YYY;urp", where XXX is the name of your new
service and YYY is the connection details, like
"socket,host=localhost,port=1234"). The service could implement the
rather generic com.sun.star.task.XJob interface, or you could even
design one or more new UNO interface types that model your communication
patterns more acurately.
Let me dig for some useful examples if you want to go that route.
> Q1. I need multiple scalc instances to connect to this uno exe. Is there
> a way to achieve "select" or "epoll" functionality in osl::socket
No. The way UNO uses this is to have a dedicated reader thread for each
accepted (socket) connection.
> Q2. I tried to use plain socket in uno shared lib but the scalc
> extension did not respond. Then I tried compiling scalc extension using
> plain sockets but had compilation issues.
> It seems the bind/listen etc are renamed in sal layer.
Not sure what you mean with the above.
Stephan
More information about the LibreOffice
mailing list