Panda3D
 All Classes Functions Variables Enumerations
config_nativenet.cxx
00001 // Filename: config_nativenet.cxx
00002 // Created by:  drose (01Mar07)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #include "config_nativenet.h"
00016 
00017 #include "socket_ip.h"
00018 #include "socket_tcp.h"
00019 #include "socket_tcp_listen.h"
00020 #include "socket_tcp_ssl.h"
00021 #include "socket_udp_incoming.h"
00022 #include "socket_udp_outgoing.h"
00023 #include "socket_udp.h"
00024 #include "socket_portable.h"
00025 #include "buffered_datagramconnection.h"
00026 #include "pandaSystem.h"
00027 
00028 #include "dconfig.h"
00029 
00030 Configure(config_nativenet);
00031 NotifyCategoryDef(nativenet, "");
00032 
00033 ConfigureFn(config_nativenet) {
00034   init_libnativenet();
00035 }
00036 
00037 
00038 ////////////////////////////////////////////////////////////////////
00039 //     Function: init_libnativenet
00040 //  Description: Initializes the library.  This must be called at
00041 //               least once before any of the functions or classes in
00042 //               this library can be used.  Normally it will be
00043 //               called by the static initializers and need not be
00044 //               called explicitly, but special cases exist.
00045 ////////////////////////////////////////////////////////////////////
00046 void
00047 init_libnativenet() {
00048   static bool initialized = false;
00049   if (initialized) {
00050     return;
00051   }
00052   initialized = true;
00053 
00054   Socket_IP::init_type();
00055   Socket_TCP::init_type();
00056   Socket_TCP_Listen::init_type();
00057 #ifdef HAVE_OPENSSL
00058   Socket_TCP_SSL::init_type();
00059 #endif
00060   Socket_UDP_Incoming::init_type();
00061   Socket_UDP_Outgoing::init_type();
00062   Socket_UDP::init_type();
00063   Buffered_DatagramConnection::init_type();
00064 
00065   PandaSystem *ps = PandaSystem::get_global_ptr();
00066   ps->add_system("nativenet");
00067 
00068   init_network();
00069 }
00070 
 All Classes Functions Variables Enumerations