Revision: 13489 http://harbour-project.svn.sourceforge.net/harbour-project/?rev=13489&view=rev Author: druzus Date: 2010-01-06 16:16:22 +0000 (Wed, 06 Jan 2010)
Log Message: ----------- 2010-01-06 17:15 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/rtl/hbznet.c ! do not use DEF_MEM_LEVEL to avoid potential problems when <zutil.h> is not available * harbour/contrib/hbnetio/netio.h * harbour/contrib/hbnetio/netiocli.c * harbour/contrib/hbnetio/netiosrv.c + implemented RPC in HBNETIO protocol + added the following client functions: check if function/procedure exists on the server side: NETIO_PROCEXISTS( <cProcName> ) -> <lExists> execute function/procedure on server the side, do not wait for confirmation: NETIO_PROCEXEC( <cProcName> [, <params,...>] ) -> <lSent> execute function/procedure on the server side and wait for confirmation: NETIO_PROCEXECW( <cProcName> [, <params,...>] ) -> <lExecuted> execute function on the server side and wait for its return value: NETIO_FUNCEXEC( <cFuncName> [, <params,...>] ) -> <xFuncRetVal> All above functions use default connection set by NETIO_CONNECT() for RPCs but it's also possible to specify server address and port in <cProcName>/<cFuncName> just like in <cFileName> parameter in RDD functions, i.e.: NETIO_PROCEXISTS( "192.168.0.1:10005:MYFUNC" ) + added new server side functions to enable/disable/check RPC support: NETIO_RPC( <pListenSocket> | <pConnectionSocket> [, <lEnable> ] ) -> <lEnabled> if RPC is enabled for listen socket then connection sockets inherit this setting. + added 4-th parameter <lRPC> to NETIO_LISTEN() function. .T. enable RPC support in returned listen socket which is later inherited by connection sockets * changed protocol version ID - current NETIO clients and servers cannot be used with old code * harbour/contrib/hbnetio/utils/netiosrv.prg * added option to enable RPC support in NETIO server If you want to make some test then you can execute netiosrv with non empty 4-th parameter as server, i.e.: ./netiosrv "" "" "" 1 and try this code as client: proc main() // pass server address to netio_connect() for non localhost tests ? "NETIO_CONNECT():", netio_connect() ? ? "DATE() function is supported:", netio_procexists( "DATE" ) ? "QOUT() function is supported:", netio_procexists( "DATE" ) ? "HB_DATETIME() function is supported:", ; netio_procexists( "HB_DATETIME" ) ? ? netio_procexec( "QOUT", repl( "=", 50 ) ) ? netio_procexec( "QOUT", "This is RPC TEST", date(), hb_datetime() ) ? netio_procexecw( "QOUT", repl( "=", 50 ) ) ? ? "SERVER DATE:", netio_funcexec( "DATE" ) ? "SERVER TIME:", netio_funcexec( "TIME" ) ? "SERVER DATETIME:", netio_funcexec( "HB_DATETIME" ) ? ? netio_funcexec( "upper", "hello world !!!" ) return Please remember that only functions linked with server are available. If you want to enabled all core functions in netiosrv then please uncomment this line in netiosrv.prg: REQUEST __HB_EXTERN__ Have a fun with a new toy. I hope that many Harbour user will find it very interesting. Please only be careful !!!. This feature allows to execute remotely _ANY_ code on the server side. _NEVER_ leave open ports with RPC support for untrusted access. Modified Paths: -------------- trunk/harbour/ChangeLog trunk/harbour/contrib/hbnetio/netio.h trunk/harbour/contrib/hbnetio/netiocli.c trunk/harbour/contrib/hbnetio/netiosrv.c trunk/harbour/contrib/hbnetio/utils/netiosrv.prg trunk/harbour/src/rtl/hbznet.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour