Browse Source

*** empty log message ***

David Rose 25 years ago
parent
commit
5a56af5c67

+ 6 - 0
panda/src/net/Sources.pp

@@ -37,6 +37,7 @@
 #begin test_bin_target
   #define TARGET test_datagram
   #define LOCAL_LIBS net
+  #define OTHER_LIBS pystub
 
   #define SOURCES \
     test_datagram.cxx
@@ -46,6 +47,7 @@
 #begin test_bin_target
   #define TARGET test_spam_client
   #define LOCAL_LIBS net
+  #define OTHER_LIBS pystub
 
   #define SOURCES \
     datagram_ui.cxx datagram_ui.h test_spam_client.cxx
@@ -55,6 +57,7 @@
 #begin test_bin_target
   #define TARGET test_spam_server
   #define LOCAL_LIBS net
+  #define OTHER_LIBS pystub
 
   #define SOURCES \
     datagram_ui.cxx datagram_ui.h test_spam_server.cxx
@@ -64,6 +67,7 @@
 #begin test_bin_target
   #define TARGET test_tcp_client
   #define LOCAL_LIBS net
+  #define OTHER_LIBS pystub
 
   #define SOURCES \
     datagram_ui.cxx datagram_ui.h test_tcp_client.cxx
@@ -73,6 +77,7 @@
 #begin test_bin_target
   #define TARGET test_tcp_server
   #define LOCAL_LIBS net
+  #define OTHER_LIBS pystub
 
   #define SOURCES \
     datagram_ui.cxx datagram_ui.h test_tcp_server.cxx
@@ -82,6 +87,7 @@
 #begin test_bin_target
   #define TARGET test_udp
   #define LOCAL_LIBS net
+  #define OTHER_LIBS pystub
 
   #define SOURCES \
     datagram_ui.cxx datagram_ui.h test_udp.cxx

+ 10 - 5
panda/src/net/connectionManager.cxx

@@ -48,11 +48,16 @@ ConnectionManager::
 //     Function: ConnectionManager::open_UDP_connection
 //       Access: Public
 //  Description: Opens a socket for sending and/or receiving UDP
-//               packets.  If the port is non-negative, it will be
-//               bound to the connection; this is primarily a useful
-//               to do when the UDP connection will be used for
-//               reading.  Use a ConnectionReader and
-//               ConnectionWriter to handle the actual communication.
+//               packets.  If the port number is negative, it will not
+//               be bound to a socket; this is generally a pointless
+//               thing to do.  If the port number is zero, a random
+//               socket will be chosen.  Otherwise, the specified
+//               port number is used.  Normally, you don't care what
+//               port a UDP connection is opened on, so you should use
+//               the default value of zero.
+//
+//               Use a ConnectionReader and ConnectionWriter to handle
+//               the actual communication.
 ////////////////////////////////////////////////////////////////////
 PT(Connection) ConnectionManager::
 open_UDP_connection(int port) {

+ 1 - 1
panda/src/net/connectionManager.h

@@ -40,7 +40,7 @@ public:
   ConnectionManager();
   virtual ~ConnectionManager();
 
-  PT(Connection) open_UDP_connection(int port = -1);
+  PT(Connection) open_UDP_connection(int port = 0);
 
   PT(Connection) open_TCP_server_rendezvous(int port, int backlog);
   PT(Connection) open_TCP_client_connection(const NetAddress &address,

+ 3 - 1
panda/src/net/test_udp.cxx

@@ -35,7 +35,9 @@ main(int argc, char *argv[]) {
     exit(1);
   }
 
-  nout << "Successfully opened UDP connection on port " << port << "\n";
+  nout << "Successfully opened UDP connection on port " 
+       << c->get_address().get_port() << " and IP "
+       << c->get_address().get_ip() << "\n";
 
   RecentConnectionReader reader(&cm);
   reader.add_connection(c);