Hi Mangesh Shukla, On Fri, Feb 15, 2013 at 10:26:44AM +0000, Shukla, Mangesh wrote: > Hi, I have an external application which connects to OpenOffice.org > application using sockets. The connection string can be given as > "uno:socket,host=localhost,port=2081 ". OpenOffice was started in > accept mode with the above string. I have an application level macro > which needs to call a function in the external application. I am > hoping to use the bridge connection using sockets to make this > communication work.
But you cannot use the same port, this port is reserved for OpenOffice, the application is already listening on that port. If I understood, what you are doing is: - OpenOffice is started in listening mode, it accepts connections from UNO bridges on port 2081 - you have an external application that interacts with OpenOffice; for this, instead of using the simple bootstrap mechanism, you create a UNO interprocess bridge using the connection URL "uno:socket,host=localhost,port=2081" - inside OpenOffice you have a Basic macro, and you want this Basic macro to interact with the external application using a socket Then, localhost:2081 is reserved for OpenOffice, listening in this port for UNO interprocess connection. OpenOffice is an css.connection.XAcceptor, the UNO bridge that uses your external application is a css.connection.XConnector. If you want your Basic macro to communicate to the external application, the external application has to be listening on another port, different from 2081, and the Basic macro has to connect to it. You have: OpenOffice listening in 2081, your application connects to OpenOffice in 2081, your application listens in NNNN, your macro connects to NNNN. You can do all this with the UNO API, or simplify it using your preferred language. The external application has to implement a sort of server, listening for requests from your Basic macro. I doubt that implementing this in UNO API would be an easy task. If written in Python, the external application could use the powerful SocketServer module; the macro can be in Basic, connecting using UNO API; or make it simpler, write the macro in Python/Java and use Python/Java directly to communicate to your external application. Regards -- Ariel Constenla-Haile La Plata, Argentina
pgp_Mtgius2Vq.pgp
Description: PGP signature