HB_NETIO help

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
mol
Posts: 2875
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 135 times
Been thanked: 66 times
Contact:

HB_NETIO help

Post by mol » Thu Apr 20, 2017 9:33 am

Hi!
I'm trying to write application using HB_Netio.


My ide was to create server app, which opens all dbf files on begin.
Then, I want to call remote procedures from my app.
I found problem - when procedure is called from remote station, it can't see opened files.
Is it right?
Is it the way to obtain this situation? Or I need to oped requested dbf every time when I want to read date from it?

Maybe these questions are stupid, but these are my first steps with HB_Netio :-)
Regards, Marek

User avatar
serge_girard
Posts: 1905
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 315 times
Been thanked: 74 times
Contact:

Post by serge_girard » Thu Apr 20, 2017 10:57 am

Hi Marek,

Better to open SHARED, read it and close it!
So every time you need it , open it and read it then close.
NETIO works great!

Serge

User avatar
serge_girard
Posts: 1905
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 315 times
Been thanked: 74 times
Contact:

Post by serge_girard » Thu Apr 20, 2017 10:57 am

Marek,

Works also perfect with local-MySQL and remote-MySQL!

Serge

User avatar
mol
Posts: 2875
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 135 times
Been thanked: 66 times
Contact:

Post by mol » Thu Apr 20, 2017 1:03 pm

serge_girard wrote:
Thu Apr 20, 2017 10:57 am
Hi Marek,

Better to open SHARED, read it and close it!
So every time you need it , open it and read it then close.
NETIO works great!

Serge
But, if I want to keep dbfs open whole time? Is it possible?

edk
Posts: 195
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 55 times
Been thanked: 123 times

Post by edk » Thu Apr 20, 2017 1:12 pm

Marek, you have to keep in mind that for each session, public variables and open files are stored separately.
There are three sessions:
1. Session of the running IO server
2. Client session
3. Session of calling the function by the client on the IO server

In an attachment you have an example of how variables behave and opened databases.
See the "kluczrob" variable, the value it has in the IO server session can be viewed by clicking in the tray on the IO server icon.
To all: I'm sorry, but the coments are in Polish
netio_marek.7z
(2.05 MiB) Downloaded 51 times
mol wrote:
Thu Apr 20, 2017 1:03 pm
But, if I want to keep dbfs open whole time? Is it possible?
Yes, it is possible, look at attachment.

Edward
Last edited by edk on Thu Apr 20, 2017 2:25 pm, edited 3 times in total.

User avatar
mol
Posts: 2875
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 135 times
Been thanked: 66 times
Contact:

Post by mol » Thu Apr 20, 2017 1:30 pm

Thank you Edward!

edk
Posts: 195
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 55 times
Been thanked: 123 times

Post by edk » Thu Apr 20, 2017 1:45 pm

You're welcome.
Make a test of how long the replies are sent from the IO server to the client. On slow connections and at large databases, sending all the data to the client can take quite some time. Consider whether it is better to send them in parts (pages), then you need to change the GUI on the client side.

User avatar
apais
Posts: 260
Joined: Fri Aug 01, 2008 6:03 pm
Location: uruguay
Has thanked: 23 times
Been thanked: 15 times
Contact:

Post by apais » Thu Apr 20, 2017 3:37 pm

or...
you can create a temporal dfb (kinda serialized remote recordset) in server, and open it from client so you don't have to transmit over the LAN/WAN
best of both worlds !
you can even store a dbf in server and make local indexes/scopes/filters
the only limit is your imagination

User avatar
mol
Posts: 2875
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 135 times
Been thanked: 66 times
Contact:

Post by mol » Thu Apr 20, 2017 5:44 pm

Ufff, I have understood idea of netio.

User avatar
serge_girard
Posts: 1905
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 315 times
Been thanked: 74 times
Contact:

Post by serge_girard » Thu Apr 20, 2017 6:21 pm

Marek,

Why would you keep dbfs open whole time? If SHARED you can not do any update.

Serge

Post Reply