[Solved] Basic Macro connect to TCP Socket Server

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
khanlon
Posts: 13
Joined: Tue Oct 24, 2017 7:36 pm

[Solved] Basic Macro connect to TCP Socket Server

Post 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.
Last edited by khanlon on Sat Nov 21, 2020 9:02 pm, edited 1 time in total.
OpenOffice 4.1.4 / Windows 10
JeJe
Volunteer
Posts: 2763
Joined: Wed Mar 09, 2016 2:40 pm

Re: Basic Macro connect to TCP Socket Server

Post 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
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Basic Macro connect to TCP Socket Server

Post 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.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
JeJe
Volunteer
Posts: 2763
Joined: Wed Mar 09, 2016 2:40 pm

Re: Basic Macro connect to TCP Socket Server

Post 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
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
JeJe
Volunteer
Posts: 2763
Joined: Wed Mar 09, 2016 2:40 pm

Re: Basic Macro connect to TCP Socket Server

Post 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.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Post Reply