Encapsulation of the data and methods for a single generic connection to take care of one part of many clients talking to a single server. 更多...
#include <vrpn_Connection.h>
Public 成员函数 | |
| vrpn_Endpoint (vrpn_TypeDispatcher *dispatcher, vrpn_int32 *connectedEndpointCounter) | |
| virtual int | pack_message (vrpn_uint32 len, struct timeval time, vrpn_int32 type, vrpn_int32 sender, const char *buffer, vrpn_uint32 class_of_service)=0 |
| virtual int | send_pending_reports (void)=0 |
| int | pack_log_description (void) |
| Packs the log description set by setup_new_connection(). | |
| virtual int | setup_new_connection (void)=0 |
| virtual void | poll_for_cookie (const timeval *timeout=NULL)=0 |
| virtual int | finish_new_connection_setup (void)=0 |
| virtual void | drop_connection (void)=0 |
| virtual void | clearBuffers (void)=0 |
| 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. | |
Accessors | |
| 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). | |
| virtual vrpn_bool | doing_okay (void) const =0 |
Manipulators | |
| void | init (void) |
| virtual int | mainloop (timeval *timeout)=0 |
| 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 (vrpn_CNAME type_name, vrpn_int32 remote_id, vrpn_int32 local_id) |
| int | newRemoteSender (vrpn_CNAME sender_name, vrpn_int32 remote_id, vrpn_int32 local_id) |
Routines to inform the endpoint of the connection of | |
which it is a part. | |
| void | setConnection (vrpn_Connection *conn) |
| vrpn_Connection * | getConnection () |
静态 Public 成员函数 | |
Routines that handle system messages | |
Visible so that vrpn_Connection can pass them to the Dispatcher | |
| static int VRPN_CALLBACK | handle_sender_message (void *userdata, vrpn_HANDLERPARAM p) |
| static int VRPN_CALLBACK | handle_type_message (void *userdata, vrpn_HANDLERPARAM p) |
Public 属性 | |
| int | status |
| long | d_remoteLogMode |
| Mode to put the remote logging in | |
| char * | d_remoteInLogName |
| Name of the remote log file | |
| char * | d_remoteOutLogName |
| Name of the remote log file | |
| char | rhostname [150] |
Protected 成员函数 | |
| virtual int | dispatch (vrpn_int32 type, vrpn_int32 sender, timeval time, vrpn_uint32 payload_len, char *bufptr) |
| int | tryToMarshall (char *outbuf, vrpn_int32 &buflen, vrpn_int32 &numOut, vrpn_uint32 len, timeval time, vrpn_int32 type, vrpn_int32 sender, const char *buffer, vrpn_uint32 classOfService) |
| 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) |
Protected 属性 | |
| vrpn_TranslationTable * | d_senders |
| vrpn_TranslationTable * | d_types |
| vrpn_TypeDispatcher * | d_dispatcher |
| vrpn_int32 * | d_connectionCounter |
| vrpn_Connection * | d_parent |
Logging | |
TCH 19 April 00; changed into two logs 16 Feb 01 | |
| vrpn_Log * | d_inLog |
| vrpn_Log * | d_outLog |
| void | setLogNames (const char *inName, const char *outName) |
| int | openLogs (void) |
Encapsulation of the data and methods for a single generic connection to take care of one part of many clients talking to a single server.
This will only be used from within the vrpn_Connection class; it should not be instantiated by users or devices. Should not be visible!
| void clear_other_senders_and_types | ( | void | ) |
Clear out the remote mapping list. This is done when a connection is dropped and we want to try and re-establish it.
|
pure virtual |
Empties out the TCP and UDP send buffers. Needed by vrpn_FileConnection to get at {udp,tcp}NumOut.
在 vrpn_Endpoint_IP 内被实现.
|
pure virtual |
Should only be called by vrpn_Connection::drop_connection(), since there's more housecleaning to do at that level. I suppose that argues against separating this function out.
在 vrpn_Endpoint_IP 内被实现.
| int local_sender_id | ( | vrpn_int32 | remote_sender | ) | const |
Returns the local mapping for the remote sender (-1 if none).
| int local_type_id | ( | vrpn_int32 | remote_type | ) | const |
Returns the local mapping for the remote type (-1 if none).
| int newLocalSender | ( | const char * | name, |
| vrpn_int32 | which ) |
A new local sender or type has been established; set the local type for it if the other side has declared it. Return 1 if the other side has one, 0 if not.
| int newRemoteType | ( | vrpn_CNAME | type_name, |
| vrpn_int32 | remote_id, | ||
| vrpn_int32 | local_id ) |
Adds a new remote type/sender and returns its index. Returns -1 on error.
| int pack_log_description | ( | void | ) |
Packs the log description set by setup_new_connection().
|
pure virtual |
Pack a message that will be sent the next time mainloop() is called. Turn off the RELIABLE flag if you want low-latency (UDP) send.
在 vrpn_Endpoint_IP 内被实现.
| 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.
|
pure virtual |
send pending report, clear the buffer. This function was protected, now is public, so we can use it to send out intermediate results without calling mainloop
在 vrpn_Endpoint_IP 内被实现.
|
pure virtual |
Sends the magic cookie and other information to its peer. It is called by both the client and server setup routines.
在 vrpn_Endpoint_IP 内被实现.
|
protected |
Calls marshall_message(); if that fails, calls send_pending_reports() and then marshalls again. Returns the number of characters successfully marshalled.
| char* d_remoteInLogName |
Name of the remote log file
| long d_remoteLogMode |
Mode to put the remote logging in
| char* d_remoteOutLogName |
Name of the remote log file
Name of the remote host we are connected to. This is kept for informational purposes. It is printed by the ceiling server, for example.