NETIO RPC
Moderator: Rathinagiri
- karweru
- Posts: 220
- Joined: Fri Aug 01, 2008 1:51 pm
- DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
- Contact:
NETIO RPC
Hi friends,
Encouraged by recent posts in this forum, especially by Rathi, I have decided to adopt sqlite as the backend database for my applications. I'm now trying to find ways to access an sqlite database sitting in a remote machine through use of Netio remote procedure calls but I've hit a snug: HMG IDE returns 'undefined reference' error when it encounters netio_connect(..), netio_funcexec(..) and netio_disconnect(..). I would really appreciate any help on this.
Encouraged by recent posts in this forum, especially by Rathi, I have decided to adopt sqlite as the backend database for my applications. I'm now trying to find ways to access an sqlite database sitting in a remote machine through use of Netio remote procedure calls but I've hit a snug: HMG IDE returns 'undefined reference' error when it encounters netio_connect(..), netio_funcexec(..) and netio_disconnect(..). I would really appreciate any help on this.
Kind regards,
Gilbert.
Gilbert.
- Rathinagiri
- Posts: 5482
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: NETIO RPC
Could you please provide a small sample project?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- karweru
- Posts: 220
- Joined: Fri Aug 01, 2008 1:51 pm
- DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
- Contact:
Re: NETIO RPC
Dear Rathi,
Here is a very simplified version.
Here is a very simplified version.
All this is client side code.
#include "hmg.ch"
Function Main
local cServer:='127.0.0.1',cPort:='2942'
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 480 ;
TITLE 'Progress window' ;
MAIN
DEFINE MAIN MENU
POPUP "File"
ITEM "Connect" ACTION {||net_connect(cServer,cPort)}
ITEM "DisConnect" ACTION {||net_disconnect(cServer,cPort)}
ITEM "CreateDatabase" ACTION {||net_open("test.db",.t.)}
ITEM "Exit" ACTION form_1.release
END POPUP
END MENU
END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return
*--------------------
FUNCTION net_connect(cServer,cPort,cPassword)
return netio_connect(cServer,cPort,cPassword)
*--------------------
FUNCTION net_disconnect(cServer,cPort)
return netio_disconnect(cServer,cPort)
*--------------------
FUNCTION net_open(cFile,lCreate)
if lCreate==Nil
lCreate:=.f.
endif
return net_exec("sqlite3_open",cFile,lCreate)
*--------------------
FUNCTION net_exec(cFunc,par1,par2,par3,par4,par5,par6,par7,par8,par9)
if pcount()>10
terminate("Too many parameters @net_exec()")
endif
return netio_funcExec(cFunc,par1,par2,par3,par4,par5,par6,par7,par8,par9)
Kind regards,
Gilbert.
Gilbert.
- Rathinagiri
- Posts: 5482
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: NETIO RPC
Thanks Gilbert, I would check it out.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- karweru
- Posts: 220
- Joined: Fri Aug 01, 2008 1:51 pm
- DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
- Contact:
Re: NETIO RPC
I think the problem is the RPC functionality is not built into the libraries comprising hmg. Any way to remedy this?
Kind regards,
Gilbert.
Gilbert.
Re: NETIO RPC
karweru wrote:I think the problem is the RPC functionality is not built into the libraries comprising hmg. Any way to remedy this?
Hola Gilbert, tengo el mismo problema, yo uso una función para crear archivos temporales filetemp(), que fue implementada ultimamente. En NetIO tambien se han implementado varias cosas ultimamente, como por ejemplo RPC.
La solución sería construir una nueva distribución de HMG.3.0.35 con el ultimo SVN de harbour, intente hacerlo por mi cuenta, pero no tuve exito, reporte esto en este post:
viewtopic.php?f=2&t=1530&start=31
Esperemos que se publique una nueva distribución de HMG.3.0.35 con el ultimo SVN de Harbour.
Salu2,
GVS
- apais
- Posts: 441
- Joined: Fri Aug 01, 2008 6:03 pm
- DBs Used: DBF, Leto, MariaDB, SQLite
- Location: uruguay
- Contact:
Re: NETIO RPC
HMG is using Harbour last Stable distribution.
At that time RPC was not yet introduced to NETIO in Harbour.
You will have to recompile NETIO from harbour SVN in order to achieve what you want.
HTH
Angel
At that time RPC was not yet introduced to NETIO in Harbour.
You will have to recompile NETIO from harbour SVN in order to achieve what you want.
HTH
Angel
Angel Pais
Web Apps consultant/architect/developer.
Web Apps consultant/architect/developer.
Re: NETIO RPC
Hi,
Please take a look for the following message by Viktor Szakáts at the Harbour developers forum:
Please take a look for the following message by Viktor Szakáts at the Harbour developers forum:
Hope that helpsHi All,
I'm glad to announce that starting yesterday you can
download "nightly" Windows binary builds in the form
of unified installer and .7z file (similar to official binary
Windows releases) from sf.net files area:
http://sourceforge.net/projects/harbour ... ies-window...
These unified builds are made available around 02:00
CET every day, and they are like the official ones, though
with a more minimal approach: msvc, win64, wince, os/2,
ms-dos and linux binaries are not included. The reason for
this is to make the build process require less resources
(time, disk space and bandwidth). For most users this won't
be a problem and these can be enable if there is a need.
What _is_ included is mingw build using official mingw
distro (v4.5.0), bcc (v5.5.1) build and all contribs, including
QT ones. hbide and hbnetio tools are also part of the
official distro, and QT runtime is provided as well. Those
interested can also find the full build logs for download.
Pls note that the binaries may not be perfectly in sync
with the nightly sources, since they are generated on
different servers.
The build machine is kindly provided by Abe Buchinger.
Many thanks to him for this contribution.
Viktor
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
- karweru
- Posts: 220
- Joined: Fri Aug 01, 2008 1:51 pm
- DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
- Contact:
Re: NETIO RPC
Thanks Grigory for the tip.
I have downloaded and copied all files from the habour build to \hmg\harbour folder and run \hmg\source\makeall.bat. However, trying to compile my program now brings the following error:
I have downloaded and copied all files from the habour build to \hmg\harbour folder and run \hmg\source\makeall.bat. However, trying to compile my program now brings the following error:
I would really appreciate any ideas to resolve this.hbmk2: Compiling Harbour sources...
Harbour 2.1.0beta2 (Rev. 15383)
Copyright (c) 1999-2010, http://harbour-project.org/
hbmk2: Compiling...
hbmk2: Linking... classy.exe
C:/hmg/harbour/lib/win/mingw/libhbwin.a(legacycd.o):legacycd.c:(.text+0x0): multiple definition of `HB_FUN_GETLASTERROR'
C:/hmg//lib/libhmg.a(c_winapimisc.o):c_winapimisc.c:(.text+0xcbc): first defined here
Kind regards,
Gilbert.
Gilbert.
Re: NETIO RPC
karweru wrote:Thanks Grigory for the tip.
I have downloaded and copied all files from the habour build to \hmg\harbour folder and run \hmg\source\makeall.bat. However, trying to compile my program now brings the following error:I would really appreciate any ideas to resolve this.hbmk2: Compiling Harbour sources...
Harbour 2.1.0beta2 (Rev. 15383)
Copyright (c) 1999-2010, http://harbour-project.org/
hbmk2: Compiling...
hbmk2: Linking... classy.exe
C:/hmg/harbour/lib/win/mingw/libhbwin.a(legacycd.o):legacycd.c:(.text+0x0): multiple definition of `HB_FUN_GETLASTERROR'
C:/hmg//lib/libhmg.a(c_winapimisc.o):c_winapimisc.c:(.text+0xcbc): first defined here
It's an rather typical problem of doubly defined winapi function(s).
Try to disable out the getlasterror() function instance which normally can be found inside hmg\source\c_winapimisc.c file.
To do this:
- locate c_winapimisc.c (it should lies into hmg\source\ as said above)
- open this file with your program editor of choice,
- move to line 416
- comment out lines 416-419 (/* */)
- save the file
- rebuild minigui lib. (makeall.bat)
If everything has gone ok, you must be able to build your appl.
---
Pete