📄 client.so
字号:
m4_comment([$Id: client.so,v 1.12 2003/10/18 19:16:07 bostic Exp $])m4_ref_title(RPC Client/Server, Client program, @RPC client, rpc/intro, rpc/server)m4_p([dnlChanging a m4_db application to remotely call a server program requiresonly a few changes on the client side:])m4_nlistbeginm4_nlist([dnlThe client application must create and use a m4_db environment; thatis, it cannot simply call the m4_ref(dbh_create) function, but mustfirst call the m4_ref(dbenv_create) function to create an environmentin which the database will live.])m4_nlist([dnlThe client application must call m4_ref(dbenv_create) using them4_ref(DB_RPCCLIENT) flag.])m4_nlist([dnlThe client application must call the additional m4_ref(DbEnv) methodm4_ref(dbenv_set_rpc_server) to specify the database server. This call mustbe made before opening the environment with the m4_ref(dbenv_open)call.])m4_nlistendm4_p([dnlThe client application provides a few pieces of information to m4_db aspart of the m4_ref(dbenv_set_rpc_server) call:])m4_nlistbeginm4_nlist([dnlA client structure. Applications wanting to control their own clientstructures can pass one in, and m4_db will use it to connect to theserver. Most applications will not make use of this argument and should passin NULL. If this argument is used, the hostname and client timeoutarguments are ignored. Applications using this mechanism mustcreate their client structures using DB_RPC_SERVERPROG as the programnumber and DB_RPC_SERVERVERS as the version number.])m4_nlist([dnlThe hostname of the server. The hostname format is not specified bym4_db, but must be in a format acceptable to the local network support-- specifically, the RPC clnt_create interface.])m4_nlist([The clienttimeout. This is the number of seconds the client will wait for theserver to respond to its requests. A default is used if this value iszero.])m4_nlist([dnlThe server timeout. This is the number of seconds the server will allowclient resources to remain idle before releasing those resources. Theresources this applies to are transactions and cursors because thoseobjects hold locks; and if a client dies, the server needs to releasethose resources in a timely manner. This value is really a hint to theserver because the server may choose to override this value with itsown.])m4_nlistendm4_p([dnlThe only other item of interest to the client is the home directorythat is given to the m4_ref(dbenv_open) call.The server is started with a list of allowed home directories.The client must use one of those names (where a name is the lastcomponent of the home directory). This allows the pathname structureon the server to change without client applications needing to beaware of it.])m4_p([dnlOnce the m4_ref(dbenv_set_rpc_server) call has been made, the client isconnected to the server, and all subsequent m4_dboperations will be forwarded to the server. The client does not need tobe otherwise aware that it is using a database server rather thanaccessing the database locally.])m4_p([dnlIt is important to realize that the client portion of the m4_db libraryacts as a simple conduit, forwarding m4_db interface arguments to theserver without interpretation. This has two important implications.First, all pathnames must be specified relative to the server. Forexample, the home directory and other configuration information passedby the application when creating its environment or databases must bepathnames for the server, not the client system. In addition, becausethere is no logical bundling of operations at the server, performanceis usually significantly less than when m4_db is embedded within theclient's address space, even if the RPC is to a local address.])m4_page_footer
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -