Main Page   Class Hierarchy   Compound List   File List   Header Files   Compound Members   File Members  

vrpn_Connection Class Reference

#include <vrpn_Connection.h>

Class diagram for vrpn_Connection:

vrpn_File_Connection

List of all members.


Public Members

virtual ~vrpn_Connection (void)
vrpn_bool doing_okay (void) const
virtual vrpn_bool connected (void) const
virtual int connect_to_client (const char * machine, int port)
Create a new endpoint for this connection and connect to using a TCP connection directly to the specified machine and port. More...

virtual int mainloop (const struct timeval * timeout = NULL)
virtual vrpn_int32 register_sender (const char * name)
virtual vrpn_int32 register_message_type (const char * name)
virtual int register_handler (vrpn_int32 type, vrpn_MESSAGEHANDLER handler, void *userdata, vrpn_int32 sender = vrpn_ANY_SENDER)
virtual int unregister_handler (vrpn_int32 type, vrpn_MESSAGEHANDLER handler, void *userdata, vrpn_int32 sender = vrpn_ANY_SENDER)
virtual int pack_message (vrpn_uint32 len, struct timeval time, vrpn_int32 type, vrpn_int32 sender, const char * buffer, vrpn_uint32 class_of_service)
virtual int send_pending_reports (void)
virtual int time_since_connection_open (struct timeval * elapsed_time)
virtual const char* sender_name (vrpn_int32 sender)
virtual const char* message_type_name (vrpn_int32 type)
virtual int register_log_filter (vrpn_LOGFILTER filter, void * userdata)
int setControlMsgTimeOffset (const timeval * offset)
allows us to construct a log with the timestamps we want. More...

virtual int save_log_so_far ()
virtual vrpn_File_Connectionget_File_Connection (void)
vrpn_TypeDispatcherd_dispatcher

Protected Members

 vrpn_Connection (unsigned short listen_port_no = vrpn_DEFAULT_LISTEN_PORT_NO, const char * local_in_logfile_name = NULL, const char * local_out_logfile_name = NULL, const char * NIC_IPaddress = NULL, vrpn_Endpoint * (* epa) (vrpn_Connection *, vrpn_int32 *) = allocateEndpoint)
 vrpn_Connection (const char * server_name, int port = vrpn_DEFAULT_LISTEN_PORT_NO, const char * local_in_logfile_name = NULL, const char * local_out_logfile_name = NULL, const char * remote_in_logfile_name = NULL, const char * remote_out_logfile_name = NULL, const char * NIC_IPaddress = NULL, vrpn_Endpoint * (* epa) (vrpn_Connection *, vrpn_int32 *) = allocateEndpoint)
virtual void init (void)
virtual void server_check_for_incoming_connections (const struct timeval * timeout = NULL)
This is called by a server-side process to see if there have been any UDP packets come in asking for a connection. If there are, it connects the TCP port and then calls handle_connection().

virtual void handle_connection (int whichEndpoint)
virtual void drop_connection (int whichEndpoint)
int delete_endpoint (int whichEndpoint)
Deletes the endpoint and NULLs the entry in the list of open endpoints.

int compact_endpoints (void)
Makes sure the endpoint array is set up cleanly for the next pass through. More...

virtual int pack_sender_description (vrpn_int32 which)
Send the sender description to ALL endpoints.

virtual int pack_type_description (vrpn_int32 which)
Send the type description to ALL endpoints.

virtual int do_callbacks_for (vrpn_int32 type, vrpn_int32 sender, struct timeval time, vrpn_uint32 len, const char * buffer)
int message_type_is_registered (const char *) const
int doSystemCallbacksFor (vrpn_HANDLERPARAM, void *)
virtual void updateEndpoints (void)
their constructors haven't executed yet.).

int connectionStatus
vrpn_Endpointd_endpoints [vrpn_MAX_ENDPOINTS]
vrpn_int32 d_numEndpoints
vrpn_int32 d_numConnectedEndpoints
need exactly one copy per Connection, so it's on the Connection.

int listen_udp_sock
int listen_tcp_sock
timeval start_time
const char* d_NIC_IP
int d_serverLogCount
vrpn_int32 d_serverLogMode
char* d_serverLogName
vrpn_Endpoint* (*  d_endpointAllocator )(vrpn_Connection *, vrpn_int32 *)
vrpn_bool d_updateEndpoint

Static Protected Members

vrpn_EndpointallocateEndpoint (vrpn_Connection *, vrpn_int32 * connectedEC)
since it'll be called from a constructor.

int handle_UDP_message (void * userdata, vrpn_HANDLERPARAM p)
int handle_log_message (void * userdata, vrpn_HANDLERPARAM p)
int handle_disconnect_message (void * userdata, vrpn_HANDLERPARAM p)

Detailed Description


Member Function Documentation

vrpn_Connection::~vrpn_Connection (void) [virtual]

vrpn_bool vrpn_Connection::doing_okay (void) const

vrpn_bool vrpn_Connection::connected (void) const [virtual]

int vrpn_Connection::connect_to_client (const char * machine, int port) [virtual]

Create a new endpoint for this connection and connect to using a TCP connection directly to the specified machine and port.

This bypasses the UDP send, and is used as part of the vrpn "RSH" startup, where the server is started by the client program and calls it back at a specified port.

Returns 0 on success and -1 on failure.

int vrpn_Connection::mainloop (const struct timeval * pTimeout = NULL) [virtual]

vrpn_int32 vrpn_Connection::register_sender (const char * name) [virtual]

vrpn_int32 vrpn_Connection::register_message_type (const char * name) [virtual]

int vrpn_Connection::register_handler (vrpn_int32 type, vrpn_MESSAGEHANDLER handler, void * userdata, vrpn_int32 sender = vrpn_ANY_SENDER) [virtual]

int vrpn_Connection::unregister_handler (vrpn_int32 type, vrpn_MESSAGEHANDLER handler, void * userdata, vrpn_int32 sender = vrpn_ANY_SENDER) [virtual]

int vrpn_Connection::pack_message (vrpn_uint32 len, struct timeval time, vrpn_int32 type, vrpn_int32 sender, const char * buffer, vrpn_uint32 class_of_service) [virtual]

int vrpn_Connection::send_pending_reports (void) [virtual]

Reimplemented in vrpn_File_Connection.

int vrpn_Connection::time_since_connection_open (struct timeval * elapsed_time) [virtual]

const char * vrpn_Connection::sender_name (vrpn_int32 sender) [virtual]

const char * vrpn_Connection::message_type_name (vrpn_int32 type) [virtual]

int vrpn_Connection::register_log_filter (vrpn_LOGFILTER filter, void * userdata) [virtual]

int vrpn_Connection::setControlMsgTimeOffset (const timeval * offset)

allows us to construct a log with the timestamps we want.

See vrpn_Endpoint::setControlMsgTimeOffset() for more.

int vrpn_Connection::save_log_so_far () [virtual]

vrpn_File_Connection * vrpn_Connection::get_File_Connection (void) [virtual]

Reimplemented in vrpn_File_Connection.

vrpn_Connection::vrpn_Connection (unsigned short listen_port_no = vrpn_DEFAULT_LISTEN_PORT_NO, const char * local_in_logfile_name = NULL, const char * local_out_logfile_name = NULL, const char * NIC_IPaddress = NULL, vrpn_Endpoint *(* epa)(vrpn_Connection *,vrpn_int32 *) = allocateEndpoint) [protected]

vrpn_Connection::vrpn_Connection (const char * station_name, int port = vrpn_DEFAULT_LISTEN_PORT_NO, const char * local_in_logfile_name = NULL, const char * local_out_logfile_name = NULL, const char * remote_in_logfile_name = NULL, const char * remote_out_logfile_name = NULL, const char * NIC_IPaddress = NULL, vrpn_Endpoint *(* epa)(vrpn_Connection *,vrpn_int32 *) = allocateEndpoint) [protected]

void vrpn_Connection::init (void) [protected, virtual]

virtual void vrpn_Connection::server_check_for_incoming_connections (const struct timeval * timeout = NULL) [protected, virtual]

This is called by a server-side process to see if there have been any UDP packets come in asking for a connection. If there are, it connects the TCP port and then calls handle_connection().

void vrpn_Connection::handle_connection (int endpointIndex) [protected, virtual]

void vrpn_Connection::drop_connection (int whichEndpoint) [protected, virtual]

int vrpn_Connection::delete_endpoint (int endpointIndex) [protected]

Deletes the endpoint and NULLs the entry in the list of open endpoints.

int vrpn_Connection::compact_endpoints (void) [protected]

Makes sure the endpoint array is set up cleanly for the next pass through.

XXX HACK - this is fragile and bound to break. Should replace with STL or some other clean linked list that guarantees traversal in spite of deletions.

virtual int vrpn_Connection::pack_sender_description (vrpn_int32 which) [protected, virtual]

Send the sender description to ALL endpoints.

virtual int vrpn_Connection::pack_type_description (vrpn_int32 which) [protected, virtual]

Send the type description to ALL endpoints.

int vrpn_Connection::do_callbacks_for (vrpn_int32 type, vrpn_int32 sender, struct timeval time, vrpn_uint32 payload_len, const char * buf) [protected, virtual]

int vrpn_Connection::message_type_is_registered (const char * name) const [protected]

int vrpn_Connection::doSystemCallbacksFor (vrpn_HANDLERPARAM p, void * ud) [protected]

virtual void vrpn_Connection::updateEndpoints (void) [protected, virtual]

their constructors haven't executed yet.).

vrpn_Endpoint * vrpn_Connection::allocateEndpoint (vrpn_Connection * me, vrpn_int32 * connectedEC) [static, protected]

since it'll be called from a constructor.

int vrpn_Connection::handle_UDP_message (void * userdata, vrpn_HANDLERPARAM p) [static, protected]

int vrpn_Connection::handle_log_message (void * userdata, vrpn_HANDLERPARAM p) [static, protected]

int vrpn_Connection::handle_disconnect_message (void * userdata, vrpn_HANDLERPARAM p) [static, protected]


Member Data Documentation

vrpn_TypeDispatcher* vrpn_Connection::d_dispatcher

int vrpn_Connection::connectionStatus [protected]

vrpn_Endpoint* vrpn_Connection::d_endpoints[vrpn_MAX_ENDPOINTS] [protected]

vrpn_int32 vrpn_Connection::d_numEndpoints [protected]

vrpn_int32 vrpn_Connection::d_numConnectedEndpoints [protected]

need exactly one copy per Connection, so it's on the Connection.

int vrpn_Connection::listen_udp_sock [protected]

int vrpn_Connection::listen_tcp_sock [protected]

timeval vrpn_Connection::start_time [protected]

const char* vrpn_Connection::d_NIC_IP [protected]

int vrpn_Connection::d_serverLogCount [protected]

vrpn_int32 vrpn_Connection::d_serverLogMode [protected]

char* vrpn_Connection::d_serverLogName [protected]

vrpn_Endpoint* (* vrpn_Connection::d_endpointAllocator)(vrpn_Connection *, vrpn_int32 *) [protected]

vrpn_bool vrpn_Connection::d_updateEndpoint [protected]


The documentation for this class was generated from the following files:
Generated at Fri Sep 13 15:04:06 2002 for vrpn by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999