RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_Connection_IP类 参考
+ 类 vrpn_Connection_IP 继承关系图:
+ vrpn_Connection_IP 的协作图:

Public 成员函数

 vrpn_Connection_IP (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_IP *(*epa)(vrpn_Connection *, vrpn_int32 *)=allocateEndpoint)
 
virtual int connect_to_client (const char *machine, int port)
 
virtual int mainloop (const struct timeval *timeout=NULL)
 
- Public 成员函数 继承自 vrpn_Connection
virtual vrpn_bool doing_okay (void) const
 Returns vrpn_true if the connection is okay, vrpn_false if not
 
virtual vrpn_bool connected (void) const
 
void get_log_names (char **local_in_logname, char **local_out_logname, char **remote_in_logname, char **remote_out_logname)
 
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 time_since_connection_open (struct timeval *elapsed_time)
 
virtual timeval get_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)
 Sets up a filter function for logging. Any user message to be logged is first passed to this function, and will only be logged if the function returns zero (XXX). NOTE: this only affects local logging - remote logging is unfiltered! Only user messages are filtered; all system messages are logged. Returns nonzero on failure.
 
virtual int save_log_so_far ()
 Save any messages on any endpoints which have been logged so far.
 
virtual vrpn_File_Connectionget_File_Connection (void)
 
void Jane_stop_this_crazy_thing (vrpn_uint32 stop_looking_after)
 
vrpn_uint32 get_Jane_value (void)
 
void addReference ()
 Counting references to this connection.
 
void removeReference ()
 
void setAutoDeleteStatus (bool setvalue)
 

Protected 成员函数

 vrpn_Connection_IP (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_EndpointAllocator epa=allocateEndpoint)
 
void init (void)
 Called by all constructors
 
virtual int send_pending_reports (void)
 send pending report, clear the buffer.
 
virtual void server_check_for_incoming_connections (const struct timeval *timeout=NULL)
 
virtual void handle_connection (vrpn_Endpoint *endpoint)
 
virtual void drop_connection (vrpn_Endpoint *endpoint)
 
void drop_connection_and_compact (vrpn_Endpoint *endpoint)
 
- Protected 成员函数 继承自 vrpn_Connection
 vrpn_Connection (const char *local_in_logfile_name, const char *local_out_logfile_name, vrpn_EndpointAllocator epa=allocateEndpoint)
 
 vrpn_Connection (const char *local_in_logfile_name, const char *local_out_logfile_name, const char *remote_in_logfile_name, const char *remote_out_logfile_name, vrpn_EndpointAllocator epa=allocateEndpoint)
 
int delete_endpoint (vrpn_Endpoint *endpoint)
 
int compact_endpoints (void)
 
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
 Returns message type ID, or -1 if unregistered
 
int doSystemCallbacksFor (vrpn_HANDLERPARAM, void *)
 
virtual void updateEndpoints (void)
 

静态 Protected 成员函数

static int VRPN_CALLBACK handle_UDP_message (void *userdata, vrpn_HANDLERPARAM p)
 Routines that handle system messages
 
- 静态 Protected 成员函数 继承自 vrpn_Connection
static vrpn_Endpoint_IPallocateEndpoint (vrpn_Connection *, vrpn_int32 *connectedEC)
 
static int VRPN_CALLBACK handle_log_message (void *userdata, vrpn_HANDLERPARAM p)
 Routines that handle system messages
 
static int VRPN_CALLBACK handle_disconnect_message (void *userdata, vrpn_HANDLERPARAM p)
 

Protected 属性

vrpn_uint32 d_stop_processing_messages_after
 
char * d_NIC_IP
 
Only used for a vrpn_Connection that awaits incoming connections
vrpn_SOCKET listen_udp_sock
 UDP Connect requests come here
 
vrpn_SOCKET listen_tcp_sock
 TCP Connection requests come here
 
- Protected 属性 继承自 vrpn_Connection
vrpn_uint32 d_stop_processing_messages_after
 
int connectionStatus
 Status of the connection
 
vrpn::BoundEndpointAllocator d_boundEndpointAllocator
 
vrpn::EndpointContainer d_endpoints
 
vrpn_int32 d_numConnectedEndpoints
 
timeval start_time
 Timekeeping - TCH 30 June 98
 
int d_serverLogCount
 
vrpn_int32 d_serverLogMode
 
char * d_serverLogName
 
vrpn_bool d_updateEndpoint
 

友元

VRPN_API vrpn_Connectionvrpn_get_connection_by_name (const char *cname, 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, bool force_connection=false)
 Create a client connection of arbitrary type (VRPN UDP/TCP, TCP, File, Loopback, MPI).
 
VRPN_API vrpn_Connectionvrpn_create_server_connection (const char *cname, const char *local_in_logfile_name=NULL, const char *local_out_logfile_name=NULL)
 Create a server connection of arbitrary type (VRPN UDP/TCP, TCP, File, Loopback, MPI).
 

额外继承的成员函数

- Public 属性 继承自 vrpn_Connection
vrpn_TypeDispatcher * d_dispatcher
 

构造及析构函数说明

◆ vrpn_Connection_IP() [1/2]

vrpn_Connection_IP ( 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_EndpointAllocator epa = allocateEndpoint )
protected

Make a client connection. To access this from user code, call vrpn_get_connection_by_name(). Create a connection - if server_name is not a file: name, makes an SDI-like connection to the named remote server (otherwise functions as a non-networked messaging hub). Port less than zero forces default. Currently, server_name is an extended URL that defaults to VRPN connections at the port, but can be file:: to read from a file. Other extensions should maintain this, so that VRPN uses URLs to name things that are to be connected to.

◆ vrpn_Connection_IP() [2/2]

vrpn_Connection_IP ( 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_IP *(* epa )(vrpn_Connection *, vrpn_int32 *) = allocateEndpoint )

Make a server that listens for client connections. DEPRECATED: Call vrpn_create_server_connection() with the NIC name and port number you want.

成员函数说明

◆ connect_to_client()

virtual int connect_to_client ( const char * machine,
int port )
virtual

This is similar to check connection except that it can be used to receive requests from before a server starts up

◆ drop_connection()

virtual void drop_connection ( vrpn_Endpoint * endpoint)
protectedvirtual

Drops the connection with the given, non-NULL endpoint. Depending on if we're a server or a client, this may result in the endpoints needing compacting once you're no longer iterating on the endpoint container.

◆ drop_connection_and_compact()

void drop_connection_and_compact ( vrpn_Endpoint * endpoint)
protected

Like drop_connection, except it includes the call to compact the endpoints. Only safe to call if you can guarantee no iterators are open to the container, since compact invalidates them.

◆ handle_connection()

virtual void handle_connection ( vrpn_Endpoint * endpoint)
protectedvirtual

This routine is called by a server-side connection when a new connection has just been established, and the tcp port has been connected to it.

◆ handle_UDP_message()

static int VRPN_CALLBACK handle_UDP_message ( void * userdata,
vrpn_HANDLERPARAM p )
staticprotected

Routines that handle system messages

◆ init()

void init ( void )
protected

Called by all constructors

◆ mainloop()

virtual int mainloop ( const struct timeval * timeout = NULL)
virtual

Call each time through program main loop to handle receiving any incoming messages and sending any packed messages. Returns -1 when connection dropped due to error, 0 otherwise. (only returns -1 once per connection drop). Optional argument is TOTAL time to block on select() calls; there may be multiple calls to select() per call to mainloop(), and this timeout will be divided evenly between them.

实现了 vrpn_Connection.

◆ send_pending_reports()

virtual int send_pending_reports ( void )
protectedvirtual

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_Connection.

友元及相关符号说明

◆ vrpn_create_server_connection

VRPN_API vrpn_Connection * vrpn_create_server_connection ( const char * cname,
const char * local_in_logfile_name = NULL,
const char * local_out_logfile_name = NULL )
friend

Create a server connection of arbitrary type (VRPN UDP/TCP, TCP, File, Loopback, MPI).

Returns NULL if the name is not understood or the connection cannot be created. WARNING: May not be thread safe. To create a VRPN TCP/UDP server, use a name like: vrpn:machine_name_or_ip:port machine_name_or_ip:port machine_name_or_ip :port (This port on any network card.) To create an MPI server, use a name like: mpi:MPI_COMM_WORLD mpi:comm_number When done with the object, call removeReference() on it (which will delete it if there are no other references).

◆ vrpn_get_connection_by_name

VRPN_API vrpn_Connection * vrpn_get_connection_by_name ( const char * cname,
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,
bool force_connection = false )
friend

Create a client connection of arbitrary type (VRPN UDP/TCP, TCP, File, Loopback, MPI).

WARNING: May not be thread safe. If no IP address for the NIC to use is specified, uses the default NIC. If the force_reopen flag is set, a new connection will be made even if there was already one to that server. When done with the object, call removeReference() on it (which will delete it if there are no other references).

类成员变量说明

◆ d_stop_processing_messages_after

vrpn_uint32 d_stop_processing_messages_after
protected

If this value is greater than zero, the connection should stop looking for new messages on a given endpoint after this many are found.

◆ listen_tcp_sock

vrpn_SOCKET listen_tcp_sock
protected

TCP Connection requests come here

◆ listen_udp_sock

vrpn_SOCKET listen_udp_sock
protected

UDP Connect requests come here


该类的文档由以下文件生成: