27 server.set_host(
"localhost", 4242);
30 int main(
int argc,
char *argv[]) {
33 PT(
Connection) con = prog.qManager->open_TCP_client_connection(prog.server,0);
35 nout <<
"Failed to open port to server process.\nMake sure maya2egg_server is running on localhost\n";
52 for (i = 0; i < argc; i++) {
60 prog.cWriter->
send(datagram, con);
67 prog.qManager->close_connection(con);
bool add_connection(Connection *connection)
Adds a new socket to the list of sockets the ConnectionReader will monitor.
This class handles threaded delivery of datagrams to various TCP or UDP sockets.
bool send(const Datagram &datagram, const PT(Connection) &connection, bool block=false)
Enqueues a datagram for transmittal on the indicated socket.
Represents a single TCP or UDP socket for input or output.
void add_uint8(uint8_t value)
Adds an unsigned 8-bit integer to the datagram.
void add_string(const std::string &str)
Adds a variable-length string to the datagram.
get_cwd
Returns the name of the current working directory.
The name of a file, such as a texture file or an Egg file.
std::string to_os_specific() const
Converts the filename from our generic Unix-like convention (forward slashes starting with the root a...
A specific kind of Datagram, especially for sending across or receiving from a network.
This flavor of ConnectionManager will queue up all of the reset-connection messages from the Connecti...
bool reset_connection_available() const
Returns true if one of the readers/writers/listeners reported a connection reset recently.
bool get_reset_connection(PT(Connection) &connection)
If a previous call to reset_connection_available() returned true, this function will return informati...
This flavor of ConnectionReader will read from its sockets and queue up all of the datagrams read for...
bool data_available()
Returns true if a datagram is available on the queue; call get_data() to extract the datagram.
This is the general base class for a file-converter program that reads some model file format and gen...
static void sleep(double seconds)
Suspends the current thread for at least the indicated amount of time.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.