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

vrpn_Endpoint Class Reference

#include <vrpn_Connection.h>

List of all members.


Public Members

 vrpn_Endpoint (vrpn_TypeDispatcher * dispatcher, vrpn_int32 * connectedEndpointCounter)
virtual ~vrpn_Endpoint (void)
vrpn_bool outbound_udp_open (void) const
True if the UDP outbound is open, False if not.

int local_type_id (vrpn_int32 remote_type) const
Returns the local mapping for the remote type (-1 if none).

int local_sender_id (vrpn_int32 remote_sender) const
Returns the local mapping for the remote sender (-1 if none).

vrpn_int32 tcp_outbuf_size (void) const
vrpn_int32 udp_outbuf_size (void) const
vrpn_bool clockSynced (void) const
vrpn_bool doing_okay (void) const
void init (void)
int mainloop (timeval * timeout, const char * NICaddress)
void clear_other_senders_and_types (void)
int newLocalSender (const char * name, vrpn_int32 which)
int newLocalType (const char * name, vrpn_int32 which)
int newRemoteType (cName type_name, vrpn_int32 remote_id, vrpn_int32 local_id)
int newRemoteSender (cName sender_name, vrpn_int32 remote_id, vrpn_int32 local_id)
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)
int pack_udp_description (int portno)
int pack_log_description (void)
Packs the log description set by setup_new_connection().

int handle_tcp_messages (const timeval * timeout)
int handle_udp_messages (const timeval * timeout)
int connect_tcp_to (const char * msg)
int connect_tcp_to (const char * addr, int port)
sets status to COOKIE_PENDING; returns 0 on success, -1 on failure.

int connect_udp_to (const char * addr, int port)
on failure.

vrpn_int32 set_tcp_outbuf_size (vrpn_int32 bytecount)
int setup_new_connection (void)
peer. It is called by both the client and server setup routines.

void poll_for_cookie (const timeval * timeout = NULL)
int finish_new_connection_setup (void)
void drop_connection (void)
that argues against separating this function out.

void clearBuffers (void)
Needed by vrpn_FileConnection to get at {udp,tcp}NumOut.

void setNICaddress (const char *)
int pack_sender_description (vrpn_int32 which)
Packs a sender description over our socket.

int pack_type_description (vrpn_int32 which)
Packs a type description.

int setControlMsgTimeOffset (const timeval * offset)
allows us to construct a log with the timestamps we want. More...

void setLogNames (const char * inName, const char * outName)
int openLogs (void)
int status
SOCKET d_tcpSocket
SOCKET d_tcpListenSocket
int d_tcpListenPort
waiting for it to call back.

char* remote_machine_name
int remote_UDP_port
timeval last_UDP_lob
long d_remoteLogMode
char* d_remoteInLogName
char* d_remoteOutLogName
timeval tvClockOffset
char rhostname [150]
vrpn_bool d_tcp_only
the case, then this flag should be set to true.

vrpn_Logd_inLog
vrpn_Logd_outLog

Static Public Members

int handle_sender_message (void * userdata, vrpn_HANDLERPARAM p)
int handle_type_message (void * userdata, vrpn_HANDLERPARAM p)

Protected Members

int getOneTCPMessage (int fd, char * buf, int buflen)
int getOneUDPMessage (char * buf, int buflen)
These two functions are ALMOST identical, but hard to combine.

virtual int dispatch (vrpn_int32 type, vrpn_int32 sender, timeval time, vrpn_uint32 payload_len, char * bufptr)
int tryToMarshall (char * outbuf, int &buflen, int &numOut, vrpn_uint32 len, timeval time, vrpn_int32 type, vrpn_int32 sender, const char * buffer, vrpn_uint32 classOfService)
Returns the number of characters successfully marshalled.

int marshall_message (char * outbuf,vrpn_uint32 outbuf_size, vrpn_uint32 initial_out, vrpn_uint32 len, struct timeval time, vrpn_int32 type, vrpn_int32 sender, const char * buffer, vrpn_uint32 sequenceNumber)
Marshal the message into the buffer if it will fit. More...

SOCKET d_udpOutboundSocket
SOCKET d_udpInboundSocket
need to know which server each message is from.

char* d_tcpOutbuf
char* d_udpOutbuf
vrpn_int32 d_tcpBuflen
vrpn_int32 d_udpBuflen
vrpn_int32 d_tcpNumOut
vrpn_int32 d_udpNumOut
vrpn_int32 d_tcpSequenceNumber
vrpn_int32 d_udpSequenceNumber
vrpn_float64 d_tcpAlignedInbuf [vrpn_CONNECTION_TCP_BUFLEN / sizeof(vrpn_float64) + 1]
vrpn_float64 d_udpAlignedInbuf [vrpn_CONNECTION_UDP_BUFLEN / sizeof(vrpn_float64) + 1]
char* d_tcpInbuf
char* d_udpInbuf
char* d_NICaddress
timeval d_controlMsgTimeOffset
vrpn_TranslationTabled_senders
vrpn_TranslationTabled_types
vrpn_TypeDispatcherd_dispatcher
vrpn_int32* d_connectionCounter


Detailed Description


Member Function Documentation

vrpn_Endpoint::vrpn_Endpoint (vrpn_TypeDispatcher * dispatcher, vrpn_int32 * connectedEndpointCounter)

vrpn_Endpoint::~vrpn_Endpoint (void) [virtual]

vrpn_bool vrpn_Endpoint::outbound_udp_open (void) const

True if the UDP outbound is open, False if not.

int vrpn_Endpoint::local_type_id (vrpn_int32 remote_type) const

Returns the local mapping for the remote type (-1 if none).

int vrpn_Endpoint::local_sender_id (vrpn_int32 remote_sender) const

Returns the local mapping for the remote sender (-1 if none).

vrpn_int32 vrpn_Endpoint::tcp_outbuf_size (void) const

vrpn_int32 vrpn_Endpoint::udp_outbuf_size (void) const

vrpn_bool vrpn_Endpoint::clockSynced (void) const

vrpn_bool vrpn_Endpoint::doing_okay (void) const

void vrpn_Endpoint::init (void)

int vrpn_Endpoint::mainloop (timeval * timeout, const char * NICaddress)

void vrpn_Endpoint::clear_other_senders_and_types (void)

int vrpn_Endpoint::newLocalSender (const char * name, vrpn_int32 which)

int vrpn_Endpoint::newLocalType (const char * name, vrpn_int32 which)

int vrpn_Endpoint::newRemoteType (cName type_name, vrpn_int32 remote_id, vrpn_int32 local_id)

int vrpn_Endpoint::newRemoteSender (cName sender_name, vrpn_int32 remote_id, vrpn_int32 local_id)

int vrpn_Endpoint::pack_message (vrpn_uint32 len, struct timeval time, vrpn_int32 type, vrpn_int32 sender, const char * buffer, vrpn_uint32 class_of_service)

int vrpn_Endpoint::send_pending_reports (void) [virtual]

int vrpn_Endpoint::pack_udp_description (int portno)

int vrpn_Endpoint::pack_log_description (void)

Packs the log description set by setup_new_connection().

int vrpn_Endpoint::handle_tcp_messages (const timeval * timeout)

int vrpn_Endpoint::handle_udp_messages (const timeval * timeout)

int vrpn_Endpoint::connect_tcp_to (const char * msg)

int vrpn_Endpoint::connect_tcp_to (const char * addr, int port)

sets status to COOKIE_PENDING; returns 0 on success, -1 on failure.

int vrpn_Endpoint::connect_udp_to (const char * addr, int port)

on failure.

vrpn_int32 vrpn_Endpoint::set_tcp_outbuf_size (vrpn_int32 bytecount)

int vrpn_Endpoint::setup_new_connection (void)

peer. It is called by both the client and server setup routines.

void vrpn_Endpoint::poll_for_cookie (const timeval * pTimeout = NULL)

int vrpn_Endpoint::finish_new_connection_setup (void)

void vrpn_Endpoint::drop_connection (void)

that argues against separating this function out.

void vrpn_Endpoint::clearBuffers (void)

Needed by vrpn_FileConnection to get at {udp,tcp}NumOut.

void vrpn_Endpoint::setNICaddress (const char * address)

int vrpn_Endpoint::pack_sender_description (vrpn_int32 which)

Packs a sender description over our socket.

int vrpn_Endpoint::pack_type_description (vrpn_int32 which)

Packs a type description.

int vrpn_Endpoint::setControlMsgTimeOffset (const timeval * offset)

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

Allows us to construct a log file with something other than wall-clock time for system messages. I was having a problem with dropped connection, specifically, but if other messages are a problem, it can be extended to those.

void vrpn_Endpoint::setLogNames (const char * inName, const char * outName)

int vrpn_Endpoint::openLogs (void)

int vrpn_Endpoint::handle_sender_message (void * userdata, vrpn_HANDLERPARAM p) [static]

int vrpn_Endpoint::handle_type_message (void * userdata, vrpn_HANDLERPARAM p) [static]

int vrpn_Endpoint::getOneTCPMessage (int fd, char * buf, int buflen) [protected]

int vrpn_Endpoint::getOneUDPMessage (char * buf, int buflen) [protected]

These two functions are ALMOST identical, but hard to combine.

int vrpn_Endpoint::dispatch (vrpn_int32 type, vrpn_int32 sender, timeval time, vrpn_uint32 payload_len, char * bufptr) [protected, virtual]

int vrpn_Endpoint::tryToMarshall (char * outbuf, int & buflen, int & numOut, vrpn_uint32 len, timeval time, vrpn_int32 type, vrpn_int32 sender, const char * buffer, vrpn_uint32 sequenceNumber) [protected]

Returns the number of characters successfully marshalled.

int vrpn_Endpoint::marshall_message (char * outbuf, vrpn_uint32 outbuf_size, vrpn_uint32 initial_out, vrpn_uint32 len, struct timeval time, vrpn_int32 type, vrpn_int32 sender, const char * buffer, vrpn_uint32 seqNo) [protected]

Marshal the message into the buffer if it will fit.

Return the number of characters sent (either 0 or the number requested). This function should not be called directly; rather, call tryToMarshall, which will flush the outgoing buffer if the marshalling attempt fails.


Member Data Documentation

int vrpn_Endpoint::status

SOCKET vrpn_Endpoint::d_tcpSocket

SOCKET vrpn_Endpoint::d_tcpListenSocket

int vrpn_Endpoint::d_tcpListenPort

waiting for it to call back.

char* vrpn_Endpoint::remote_machine_name

int vrpn_Endpoint::remote_UDP_port

timeval vrpn_Endpoint::last_UDP_lob

long vrpn_Endpoint::d_remoteLogMode

char* vrpn_Endpoint::d_remoteInLogName

char* vrpn_Endpoint::d_remoteOutLogName

timeval vrpn_Endpoint::tvClockOffset

char vrpn_Endpoint::rhostname[150]

vrpn_bool vrpn_Endpoint::d_tcp_only

the case, then this flag should be set to true.

vrpn_Log* vrpn_Endpoint::d_inLog

vrpn_Log* vrpn_Endpoint::d_outLog

SOCKET vrpn_Endpoint::d_udpOutboundSocket [protected]

SOCKET vrpn_Endpoint::d_udpInboundSocket [protected]

need to know which server each message is from.

char* vrpn_Endpoint::d_tcpOutbuf [protected]

char* vrpn_Endpoint::d_udpOutbuf [protected]

vrpn_int32 vrpn_Endpoint::d_tcpBuflen [protected]

vrpn_int32 vrpn_Endpoint::d_udpBuflen [protected]

vrpn_int32 vrpn_Endpoint::d_tcpNumOut [protected]

vrpn_int32 vrpn_Endpoint::d_udpNumOut [protected]

vrpn_int32 vrpn_Endpoint::d_tcpSequenceNumber [protected]

vrpn_int32 vrpn_Endpoint::d_udpSequenceNumber [protected]

vrpn_float64 vrpn_Endpoint::d_tcpAlignedInbuf[vrpn_CONNECTION_TCP_BUFLEN / sizeof(vrpn_float64) + 1] [protected]

vrpn_float64 vrpn_Endpoint::d_udpAlignedInbuf[vrpn_CONNECTION_UDP_BUFLEN / sizeof(vrpn_float64) + 1] [protected]

char* vrpn_Endpoint::d_tcpInbuf [protected]

char* vrpn_Endpoint::d_udpInbuf [protected]

char* vrpn_Endpoint::d_NICaddress [protected]

timeval vrpn_Endpoint::d_controlMsgTimeOffset [protected]

vrpn_TranslationTable* vrpn_Endpoint::d_senders [protected]

vrpn_TranslationTable* vrpn_Endpoint::d_types [protected]

vrpn_TypeDispatcher* vrpn_Endpoint::d_dispatcher [protected]

vrpn_int32* vrpn_Endpoint::d_connectionCounter [protected]


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