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);
A specific kind of Datagram, especially for sending across or receiving from a network.
bool send(const Datagram &datagram, const PT(Connection) &connection, bool block=false)
Enqueues a datagram for transmittal on the indicated socket.
get_cwd
Returns the name of the current working directory.
This flavor of ConnectionManager will queue up all of the reset-connection messages from the Connecti...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool get_reset_connection(PT(Connection) &connection)
If a previous call to reset_connection_available() returned true, this function will return informati...
bool reset_connection_available() const
Returns true if one of the readers/writers/listeners reported a connection reset recently.
The name of a file, such as a texture file or an Egg file.
bool data_available()
Returns true if a datagram is available on the queue; call get_data() to extract the datagram.
void add_string(const std::string &str)
Adds a variable-length string to the datagram.
This class handles threaded delivery of datagrams to various TCP or UDP sockets.
static void sleep(double seconds)
Suspends the current thread for at least the indicated amount of time.
bool add_connection(Connection *connection)
Adds a new socket to the list of sockets the ConnectionReader will monitor.
This flavor of ConnectionReader will read from its sockets and queue up all of the datagrams read for...
void add_uint8(uint8_t value)
Adds an unsigned 8-bit integer to the datagram.
This is the general base class for a file-converter program that reads some model file format and gen...
Represents a single TCP or UDP socket for input or output.
std::string to_os_specific() const
Converts the filename from our generic Unix-like convention (forward slashes starting with the root a...