Page 1 of 1

[Solved] Basic Macro connect to TCP Socket Server

PostPosted: Sat Nov 21, 2020 3:05 am
by khanlon
These questions pertain to the most recent OO and Libre versions and Windows 10.

Is it possible in ooBasic or Libreoffice Basic to send data to TCP socket and then receive the response? And if so, are there some examples posted for reference? I have spent considerable time looking without success.

Thanks.

Re: Basic Macro connect to TCP Socket Server

PostPosted: Sat Nov 21, 2020 1:23 pm
by JeJe
Don't know anything about this but there is this thread. Loads of other search results for Openoffice or LibreOffice and TCP

viewtopic.php?f=20&t=24331

Edit: not in BASIC though

Re: Basic Macro connect to TCP Socket Server

PostPosted: Sat Nov 21, 2020 2:14 pm
by Villeroy
The simplified macro language StarBasic is hard wired to the context of the embedding office suite. Controlling a running office suite via network sockets requires a true programming language with an UNO bridge such as Java, Cpp or Python.

Re: Basic Macro connect to TCP Socket Server

PostPosted: Sat Nov 21, 2020 2:44 pm
by JeJe
It might or might not be possible to do it with the Windows API and adapting code available in VB6 to OOBASIC... one example in a zip here...

https://www.vbforums.com/showthread.php ... cp-connect

Re: Basic Macro connect to TCP Socket Server

PostPosted: Sat Nov 21, 2020 2:52 pm
by JeJe
Another way would be if you have a compiler that can compile an adaptation of that or some other code to a dll then you could make that and call it from within OOBasic.