OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Client/server connection via basic macro

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
arnold
General User
General User


Joined: 20 Apr 2005
Posts: 7

PostPosted: Wed Apr 20, 2005 12:33 pm    Post subject: Client/server connection via basic macro Reply with quote

I'm quite new to macros under OO and am running OO 1.1.4 on a windows(me & 98 )/linux(debian/Mepis) network and would like to be able to send/receive messages to/from another machine (or possibly another program on the same machine) on the network via Inet sockets.

The main purpose is to have the other program return a suitably modified text string whenever it receives an input string from OO.

To test the code I have created a sender/listener in Perl. They can correspond with each other. Currently they communicate with each other on 'localhost' and at port 9000.

I have also reviewed the various pieces of code that seemed to deal with similar issues on the macro/api part of this forum. None of the ones I have found do what I want and I have tried to adapt
http://www.oooforum.org/forum/viewtopic.phtml?p=26353&highlight=http+request#26353
but without much success so far. Sad

What I am looking for is a reference or code samples for such interprocess communications. The manuals I have been able to find on the OpenOffice.org site seem to all deal with Java and C++ and I am unsure how far they an be applied to Basic macros.

There are some comments in the documentation about making OO 'listen' on some port, but I don't quite see that this relates to what I want to do since I understand this part to be useful for 'driving' oo remotely.

Since I don't want to make this post too long, please let me know if I can supply extra information or answer any questions.

TIA,
Arnold
Back to top
View user's profile Send private message
ms777
Super User
Super User


Joined: 07 Feb 2004
Posts: 1355

PostPosted: Wed Apr 20, 2005 1:49 pm    Post subject: Reply with quote

I am no expert on interprocess communication, but I believe the methods shown in http://www.oooforum.org/forum/viewtopic.phtml?p=26353&highlight=http+request#26353 are the right ones for this topic...
What is the error you run into there ?
Back to top
View user's profile Send private message
arnold
General User
General User


Joined: 20 Apr 2005
Posts: 7

PostPosted: Wed Apr 20, 2005 2:23 pm    Post subject: Reply with quote

Yeah, it looks like it is the way to go. After leaving this problem for a while and thinking about it a bit more, I have made some progress and I can now send a message to the perl receiver.

But I'm really 'walking blind' on this and so I'm not surprised to get errors, but much prefer to have something to guide my baby steps and give me more hints on what error message might mean and how to do things 'right'.

I'm mainly interested in finding out more documentation about the possible options for the various methods to handle a two-way 'conversation' with handshaking and without blocking.

Is there a way to test whether or not data is available or do I have to accept the whole thing locking up until data comes from the link and bomb completely if it does not?

Arnold
Back to top
View user's profile Send private message
ms777
Super User
Super User


Joined: 07 Feb 2004
Posts: 1355

PostPosted: Wed Apr 20, 2005 2:28 pm    Post subject: Reply with quote

see the unlucky history of http://www.openoffice.org/issues/show_bug.cgi?id=46752. Presently, I see only a solution when you receive fixed length messages with these OO methods.
Back to top
View user's profile Send private message
ms777
Super User
Super User


Joined: 07 Feb 2004
Posts: 1355

PostPosted: Wed Apr 20, 2005 2:33 pm    Post subject: Reply with quote

P.S. Did you try the UCB openFileReadWrite method ? They should have the available() and readsomebytes() methods correctly implemented (connector does not have them)
Back to top
View user's profile Send private message
arnold
General User
General User


Joined: 20 Apr 2005
Posts: 7

PostPosted: Wed Apr 20, 2005 3:48 pm    Post subject: Reply with quote

I had seen the bug report and aftwr reading it again, I was wondering if the problem applies only to WinXX platforms - I could not quite decide from the back and forth following the problem report Wink

If it worked under linux, I might be able to move there until the problem is fixed so I can get on with it. Testing it might be my next possible step forward/sideways Wink - although I'm a bit wary - who knows what other issues will then come to the fore .

After looking over the references for UCB openFileReadWrite it does not seem to be usable for my case, since I don't know how to express the returned data as a suitable URL - unless of course I write to a fixed file first and then transfer it that way - which really seems round-about way of doing it Wink
Back to top
View user's profile Send private message
ms777
Super User
Super User


Joined: 07 Feb 2004
Posts: 1355

PostPosted: Wed Apr 20, 2005 4:44 pm    Post subject: Reply with quote

I have only Windows available, and I m not aware if the bug is also there on linux.

The UCB methods can not only read from / write to local files, but also to http://... addresses with specified port number / password. The format is somewhere in the SDK (but I do go to bed now and do not search for it Smile ). So if you talk to your perl scripts via the standard GET syntax, the UCB methods could be working.
Back to top
View user's profile Send private message
arnold
General User
General User


Joined: 20 Apr 2005
Posts: 7

PostPosted: Thu Apr 21, 2005 8:29 am    Post subject: Reply with quote

I guess we do have to sleep sometimes Wink

To use the UCB methods via http would mean I have to make the other end look like a web server - not sure that is an efficient way for me to go since I know little about the implications. Smile

I'll have a look around - perhaps if I set up things properly, since the oo end is initiating the conversation, I may be able to get away with blocking on the receive.

Just the same, thank you for your comments

Arnold
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group