Need help to find the code or direction to make the server in HMG

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
Anand
Posts: 596
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF

Need help to find the code or direction to make the server in HMG

Post by Anand »

I want to create a 'server' using HMG code which will wait for a 'port' and on receiving a html request will return data from dbf as html.
I should be able to access the server from browser using 'IP:port' like '192.168.0.100:5000'

I saw/used a similar code from HMG/MiniGUI, but I can not find it now. Need help to find the code or direction to make the server in HMG.
Regards,

Anand

Image
User avatar
Anand
Posts: 596
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF

Re: Need help to find the code or direction to make the server in HMG

Post by Anand »

mol wrote: Wed Jun 22, 2022 7:39 pm Try hbnetio sample. It should be in samples folder
Thanks Mol for the suggestion.

I tried all NETIO I found in samples folder of HMG MiniGUI Ext.
In all the server works from the client application.

But I want to access the server from browser like 127.0.0.1:2941

Any guidance how I can achieve it ?
Regards,

Anand

Image
User avatar
mol
Posts: 3825
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Need help to find the code or direction to make the server in HMG

Post by mol »

I found old sample with micro httpd
Attachments
uhttpd.zip
(44.31 KiB) Downloaded 215 times
User avatar
Anand
Posts: 596
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF

Re: Need help to find the code or direction to make the server in HMG

Post by Anand »

mol wrote: Sun Jun 26, 2022 5:37 pm I found old sample with micro httpd
Thanks Mol. I will check and revert.
Regards,

Anand

Image
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: Need help to find the code or direction to make the server in HMG

Post by Roberto Lopez »

Anand wrote: Wed Jun 22, 2022 6:10 pm I want to create a 'server' using HMG code which will wait for a 'port' and on receiving a html request will return data from dbf as html.
I should be able to access the server from browser using 'IP:port' like '192.168.0.100:5000'

I saw/used a similar code from HMG/MiniGUI, but I can not find it now. Need help to find the code or direction to make the server in HMG.
Hi!

Maybe this article I've wrote some time ago, coul help you:

https://hmgthinking.wordpress.com/2015/07/18/23/

Good Look!
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
jayadevu
Posts: 240
Joined: Tue May 19, 2009 7:10 am

Re: Need help to find the code or direction to make the server in HMG

Post by jayadevu »

Hi Anand,

Just out of curiosity, why do you want to make a "server" in HMG when Apache (which is very popular and well maintained ) and the likes do the job best.


Warm regards,

Jayadev
User avatar
Anand
Posts: 596
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF

Re: Need help to find the code or direction to make the server in HMG

Post by Anand »

Sorry to everyone for late reply.
Last week was hectic and I could only sit for company work. Our kitchen is getting repaired and I had take leave for it.

Now I have some time and I will check both Mol and Roberto post for it. Thanks to both of you.

Jayadev, I have Android app. I am using it to access DBF and NTX files on our windows server, via ip:port address. To access the port I am using a java jar which accepts the request and creates files for it. Then my Xbase++ program uses that files to generate reports from DBF/NTX database. The java jar then send the report to the app.

I want to use Harbour to do both java and XBase++ job. But first to do the java job.
Regards,

Anand

Image
User avatar
Anand
Posts: 596
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF

Re: Need help to find the code or direction to make the server in HMG

Post by Anand »

mol wrote: Sun Jun 26, 2022 5:37 pm I found old sample with micro httpd
Well I could not compile it successfully. The batch file expects some per-defind path of Harbour and I use MiniGUI Extended.
I changed the path to MiniGUI Harbour folder but it did not work.

Maybe the code are very old (2009) and expects some code which is not there now.

Anyway no problem, I will keep trying and inform of any development. Thanks for the code.

I will now check Roberto's code as I get time.
Regards,

Anand

Image
Post Reply