From: Tom H. <tom...@us...> - 2003-01-10 18:56:52
|
Update of /cvsroot/rccparser/rcclient In directory sc8-pr-cvs1:/tmp/cvs-serv3353 Modified Files: ChangeLog NEWS README acinclude.m4 configure.ac Log Message: 2003-01-10 Tom Howard <tom...@us...> * ./README Updated readme * ./acinclude.m4 * ./configure.ac Added macro from rcssnet detection * ./src/rcclient.cpp * ./src/rcclient.h * ./src/rcctest.cpp Integrated with rcssnet and added compression support Index: ChangeLog =================================================================== RCS file: /cvsroot/rccparser/rcclient/ChangeLog,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ChangeLog 6 Jan 2003 17:22:43 -0000 1.3 --- ChangeLog 10 Jan 2003 18:56:46 -0000 1.4 *************** *** 1,2 **** --- 1,16 ---- + 2003-01-10 Tom Howard <tom...@us...> + + * ./README + Updated readme + + * ./acinclude.m4 + * ./configure.ac + Added macro from rcssnet detection + + * ./src/rcclient.cpp + * ./src/rcclient.h + * ./src/rcctest.cpp + Integrated with rcssnet and added compression support + 2003-01-06 Tom Howard <tom...@us...> Index: NEWS =================================================================== RCS file: /cvsroot/rccparser/rcclient/NEWS,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NEWS 6 Jan 2003 17:22:44 -0000 1.2 --- NEWS 10 Jan 2003 18:56:47 -0000 1.3 *************** *** 1,2 **** --- 1,36 ---- + [0.0.1] + * RCClient supports compressed communications with the server, through + the use of the compression() and setCompression() functions. To + change the current compression level (default is none), you first need + to send the request to the simulator, which is done with the + compression() function. The server will then reply with either + + (ok compression LEVEL) + + or + + (warning compression_unsupported) + + or not at all if your request was lost, or the compression requested + was greater than 9. + + If you receive the warning, the data will remain uncompressed and no + further action is required. + + If you receive acknowledgement of the new compression level, you MUST + call setCompression() with the new compression level, BEFORE + rcc::Parser::doBuildCompressionOK() returns. Otherwise subsequent + data will be read at the wrong compression level, which will result in + parse errors and loss of data. + + What's more, you CANNOT send any data after your request to change to + the compression level until the server has responded of you give up + the request as lost. Sound nasty? Well it is. Unfortunately there is + no nice solution because the server uses plain UDP, which does not + guarantee reliability. Unless the server changes this is as good as + we can get. + + The rcctest example now uses compression, so demostrate how it's done. + [0.0.0] * Initial release. Please see the README file for some basic Index: README =================================================================== RCS file: /cvsroot/rccparser/rcclient/README,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** README 6 Jan 2003 17:22:46 -0000 1.2 --- README 10 Jan 2003 18:56:47 -0000 1.3 *************** *** 16,34 **** components in the following locations: ! /usr/local/bin for the rcctest executable, /usr/local/lib for ! the RCClient library and /usr/local/include/rcclient for the RCClient headers. ! You may need administrator privilages to install RCClient into the default locations. These locations can be modified by using configure's `--prefix=DIR' and related options. See `configure --help' for more details. ! RCClient has serveral features that can be enabled or disabled at configure time by using the `--enable-FEATURE[=ARG]' or `--disable-FEATURE' parameters to `configure'. `--disable-FEATURE' is ! equivlant to `--enable-FEATURE=no' and `--enable-FEATURE' is equivlant ! to `--enable-FEATURE=yes'. The only valid values for `ARG' are `yes' ! and `no'. `--enable-shared=yes' will enable the building and installation of --- 16,34 ---- components in the following locations: ! /usr/local/bin for the rcctest executable, /usr/local/lib for the ! RCClient library and /usr/local/include/rcclient for the RCClient headers. ! You may need administrator privileges to install RCClient into the default locations. These locations can be modified by using configure's `--prefix=DIR' and related options. See `configure --help' for more details. ! RCClient has several features that can be enabled or disabled at configure time by using the `--enable-FEATURE[=ARG]' or `--disable-FEATURE' parameters to `configure'. `--disable-FEATURE' is ! equivalent to `--enable-FEATURE=no' and `--enable-FEATURE' is ! equivalent to `--enable-FEATURE=yes'. The only valid values for `ARG' ! are `yes' and `no'. `--enable-shared=yes' will enable the building and installation of *************** *** 44,56 **** To link against the shared library you must either use GNU Libtool, and specify the full pathname of the RCClient shared library, or use ! `-L<prefix>/lib' during linking and do at least one of ! the following: - add `<prefix>/lib' to the ! `LD_LIBRARY_PATH' environment variable during execution - add ! `<prefix>/lib' to the `LD_RUN_PATH' environment variable ! during linking - use the `-Wl,--rpath -Wl,<prefix>/lib' ! linker flag - have your system administrator add ! `<prefix>/lib' to `/etc/ld.so.conf' ! where <prefix> is where you installed rcclient (default is /usr/local). See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual --- 44,55 ---- To link against the shared library you must either use GNU Libtool, and specify the full pathname of the RCClient shared library, or use ! `-L<prefix>/lib' during linking and do at least one of the following: ! - add `<prefix>/lib' to the `LD_LIBRARY_PATH' environment variable ! during execution - add `<prefix>/lib' to the `LD_RUN_PATH' environment ! variable during linking - use the `-Wl,--rpath -Wl,<prefix>/lib' ! linker flag - have your system administrator add `<prefix>/lib' to ! `/etc/ld.so.conf' ! where <prefix> is where you installed RCClient (default is /usr/local). See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual *************** *** 62,67 **** Your code can be compiled with the static RCClient library by adding ! `-I<prefix>/rcclient -L<prefix>/lib -lrcclient' or ! modify as necessary if you installed rcclient into non-default directories. --- 61,66 ---- Your code can be compiled with the static RCClient library by adding ! `-I<prefix>/rcclient -L<prefix>/lib -lrcclient' or modify as necessary ! if you installed rcclient into non-default directories. *************** *** 71,75 **** ======== BUILDING ======== ! Once you have successully configured RCClient, simply run `make' to build the sources. --- 70,74 ---- ======== BUILDING ======== ! Once you have successfully configured RCClient, simply run `make' to build the sources. *************** *** 106,110 **** your_client.init( your_teamname, protocol_version, goalie_flag ); ! Apon recieving your init message, the server will start to send data to your client. You can start parsing the data by either calling the operator() or by passing your client to a thread and have it call the --- 105,109 ---- your_client.init( your_teamname, protocol_version, goalie_flag ); ! Apon receiving your init message, the server will start to send data to your client. You can start parsing the data by either calling the operator() or by passing your client to a thread and have it call the *************** *** 113,117 **** The operator() does not return until some error in parsing has ! occured, so if you chose not to use a threaded approach (which is a perfectly valid thing to do) you will only be able to call send functions (such as dash and turn) from within the rcc::Parser virtual --- 112,116 ---- The operator() does not return until some error in parsing has ! occurred, so if you chose not to use a threaded approach (which is a perfectly valid thing to do) you will only be able to call send functions (such as dash and turn) from within the rcc::Parser virtual *************** *** 121,125 **** also have to make sure that you return promptly from any of the rcc::Parser virtual functions. Failure to do so may result in a ! backup of data and potential data loss if the nework buffer overflows. ============== Making Contact ============== --- 120,156 ---- also have to make sure that you return promptly from any of the rcc::Parser virtual functions. Failure to do so may result in a ! backup of data and potential data loss if the network buffer ! overflows. ! ! RCClient supports compressed communications with the server, through ! the use of the compression() and setCompression() functions. To ! change the current compression level (default is none), you first need ! to send the request to the simulator, which is done with the ! compression() function. The server will then reply with either ! ! (ok compression LEVEL) ! ! or ! ! (warning compression_unsupported) ! ! or not at all if your request was lost, or the compression requested ! was greater than 9. ! ! If you receive the warning, the data will remain uncompressed and no ! further action is required. ! ! If you receive acknowledgement of the new compression level, you MUST ! call setCompression() with the new compression level, BEFORE ! rcc::Parser::doBuildCompressionOK() returns. Otherwise subsequent ! data will be read at the wrong compression level, which will result in ! parse errors and loss of data. ! ! What's more, you CANNOT send any data after your request to change to ! the compression level until the server has responded of you give up ! the request as lost. Sound nasty? Well it is. Unfortunately there is ! no nice solution because the server uses plain UDP, which does not ! guarantee reliability. Unless the server changes this is as good as ! we can get. ============== Making Contact ============== Index: acinclude.m4 =================================================================== RCS file: /cvsroot/rccparser/rcclient/acinclude.m4,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** acinclude.m4 6 Jan 2003 15:11:07 -0000 1.1.1.1 --- acinclude.m4 10 Jan 2003 18:56:47 -0000 1.2 *************** *** 23,24 **** --- 23,48 ---- AS_VAR_POPDEF([ac_lib_rccparser])dnl ])# AC_LIB_RCCPARSER + # AC_LIB_RCSSNET([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) + # --------------------------------------------------------- + # Checks for the rcssnet library + AC_DEFUN([AC_LIB_RCSSNET], + [AS_VAR_PUSHDEF([ac_lib_rcssnet], [ac_cv_lib_rcssnet])dnl + AC_CACHE_CHECK(whether the rcssnet library is available, ac_cv_lib_rcssnet, + [AC_LANG_PUSH(C++) + OLD_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -lrcssnet" + AC_LINK_IFELSE([@%:@include <rcssbase/net/udpsocket.hpp> + int main() + { + rcss::net::UDPSocket udps(); + return 0; + }], + [AS_VAR_SET(ac_lib_rcssnet, yes)], + [AS_VAR_SET(ac_lib_rcssnet, no) + LDFLAGS="$OLD_LDFLAGS" + ]) + AC_LANG_POP(C++) + ]) + AS_IF([test AS_VAR_GET(ac_lib_rcssnet) = yes], [$1], [$2]) + AS_VAR_POPDEF([ac_lib_rcssnet])dnl + ])# AC_LIB_RCSSNET Index: configure.ac =================================================================== RCS file: /cvsroot/rccparser/rcclient/configure.ac,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** configure.ac 6 Jan 2003 17:26:33 -0000 1.2 --- configure.ac 10 Jan 2003 18:56:47 -0000 1.3 *************** *** 16,19 **** --- 16,20 ---- dnl Checks for libraries. AC_CHECK_LIB(m, cos) + AC_CHECK_LIB(z, deflate) AC_LIB_RCCPARSER([], [ *************** *** 26,42 **** dnl Checks for header files. - AC_CHECK_HEADERS(unistd.h) - AC_CHECK_HEADERS(math.h) - AC_CHECK_HEADERS(sys/time.h) ! AC_CHECK_TYPES([socklen_t], [], [], [ ! #include <sys/types.h> ! #include <sys/socket.h> ! ]) ! AC_CHECK_TYPES([size_t], [], [], [ ! #include <sys/types.h> ! #include <sys/socket.h> ]) ! AC_CHECK_HEADER([rcssbase/udpsocket.h], [], [ AC_MSG_ERROR([Could not find the rcsoccersim/rcssbase files or they are out of date. Please (re)install rcsoccersim/rcssbase before --- 27,40 ---- dnl Checks for header files. ! AC_LIB_RCSSNET([], [ ! AC_MSG_ERROR([Could not find the rcsoccersim/rcssbase files or they ! are out of date. Please (re)install rcsoccersim/rcssbase before ! proceeding or specify the path to the rccbase headers by adding ! 'CXXFLAGS=\"-I<INCLUDEDIR> <YOUR_OTHER_FLAGS>\"' to configure's ! command line arguments.]) ]) ! ! AC_CHECK_HEADER([rcssbase/gzstream.h], [], [ AC_MSG_ERROR([Could not find the rcsoccersim/rcssbase files or they are out of date. Please (re)install rcsoccersim/rcssbase before |