Changeset 65


Ignore:
Timestamp:
Jul 11, 2010, 9:39:56 AM (14 years ago)
Author:
Torben Dannhauer
Message:

new cluster implementation added: ENet
ENet is a reliable UDP implementation with quite simple usage and high performance for transmission with small or medium size packet.

Location:
osgVisual
Files:
24 added
3 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/CMakeLists.txt

    r60 r65  
    154154
    155155# Module cluster
    156 SET(USE_CLUSTER_UDP ON CACHE BOOL "Enable to use the UDP Implementation for the cluster interface")
    157 SET(USE_CLUSTER_ASIO_TCP_IOSTREAM ON CACHE BOOL "Enable to use the Boost ASIO TCP iostream Implementation for the cluster interface")
     156SET(USE_CLUSTER_UDP OFF CACHE BOOL "Enable to use the UDP Implementation for the cluster interface")
     157SET(USE_CLUSTER_ASIO_TCP_IOSTREAM OFF CACHE BOOL "Enable to use the Boost ASIO TCP iostream implementation for the cluster interface")
     158SET(USE_CLUSTER_ENET ON CACHE BOOL "Enable to use the ENet reliable UDP library implementation for the cluster interface")
    158159IF( USE_CLUSTER_UDP   )
    159160                SET(SOURCES
     
    186187ENDIF()
    187188
    188 IF(NOT USE_CLUSTER_UDP AND NOT USE_CLUSTER_ASIO_TCP_IOSTREAM)
     189IF( USE_CLUSTER_ENET )
     190                SET(SOURCES
     191                        ${SOURCES}
     192                        include/cluster/dataIO_cluster.h
     193                        include/cluster/dataIO_clusterENet.h
     194                        src/cluster/dataIO_clusterENet.cpp
     195                        include/cluster/dataIO_clusterENet_implementation.h
     196                        src/cluster/dataIO_clusterENet_implementation.cpp
     197                        src/cluster/enet/callbacks.c
     198                        src/cluster/enet/compress.c
     199                        src/cluster/enet/host.c
     200                        src/cluster/enet/list.c
     201                        src/cluster/enet/packet.c
     202                        src/cluster/enet/peer.c
     203                        src/cluster/enet/protocol.c
     204                        src/cluster/enet/unix.c
     205                        src/cluster/enet/win32.c
     206                        include/cluster/enet/callbacks.h
     207                        include/cluster/enet/enet.h
     208                        include/cluster/enet/list.h
     209                        include/cluster/enet/protocol.h
     210                        include/cluster/enet/time.h
     211                        include/cluster/enet/types.h
     212                        include/cluster/enet/unix.h
     213                        include/cluster/enet/utility.h
     214                        include/cluster/enet/win32.h
     215                )
     216                ADD_DEFINITIONS( "-DUSE_CLUSTER_ENET" )
     217               
     218ENDIF()
     219
     220IF(NOT USE_CLUSTER_UDP AND NOT USE_CLUSTER_ASIO_TCP_IOSTREAM AND NOT USE_CLUSTER_ENET)
    189221                SET(SOURCES
    190222                        ${SOURCES}
     
    297329ENDIF(USE_VISTA2D)
    298330
    299 
     331IF(USE_CLUSTER_ENET)
     332        TARGET_LINK_LIBRARIES(osgVisual "winmm.lib" "ws2_32.lib" )
     333ENDIF(USE_CLUSTER_ENET)
    300334
    301335# CMAKE Fix for VS to not prepend build type to path.
  • osgVisual/include/dataIO/visual_dataIO.h

    r58 r65  
    3232        #include <dataIO_clusterUDP.h>
    3333#endif
    34 
     34#ifdef USE_CLUSTER_ENET
     35        #include <dataIO_clusterENet.h>
     36#endif
    3537
    3638
  • osgVisual/src/dataIO/visual_dataIO.cpp

    r59 r65  
    7777                cluster = new dataIO_clusterUDP();
    7878        #endif
    79         cluster->init(arguments_, clusterMode, slotContainer, true, false);
     79        #ifdef USE_CLUSTER_ENET
     80                cluster = new dataIO_clusterENet();
     81        #endif
     82        if(cluster.valid())
     83                cluster->init(arguments_, clusterMode, slotContainer, true, false);
    8084
    8185        // Create extLink.
     
    114118                viewer = NULL;
    115119
    116                 cluster->shutdown();
     120                if(cluster.valid())
     121                        cluster->shutdown();
     122                if(extLink.valid())
    117123                extLink->shutdown();
    118124        }
Note: See TracChangeset for help on using the changeset viewer.