15 #include "mayaToEgg_client.h" 33 server.set_host(
"localhost", 4242);
36 int main(
int argc,
char *argv[]) {
45 PT(
Connection) con = prog.qManager->open_TCP_client_connection(prog.server,0);
47 nout <<
"Failed to open port to server process.\nMake sure maya2egg_server is running on localhost\n";
64 for (i = 0; i < argc; i++) {
72 prog.cWriter->
send(datagram, con);
void add_uint8(PN_uint8 value)
Adds an unsigned 8-bit integer to the datagram.
A specific kind of Datagram, especially for sending across or receiving from a network.
void add_string(const string &str)
Adds a variable-length string to the datagram.
bool send(const Datagram &datagram, const PT(Connection) &connection, bool block=false)
Enqueues a datagram for transmittal on the indicated socket.
This flavor of ConnectionManager will queue up all of the reset-connection messages from the Connecti...
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...
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...
static Filename get_cwd()
Returns the name of the current working directory.
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.
string to_os_specific() const
Converts the filename from our generic Unix-like convention (forward slashes starting with the root a...
bool close_connection(const PT(Connection) &connection)
Terminates a UDP or TCP socket previously opened.