14#ifndef CCONNECTIONREPOSITORY_H
15#define CCONNECTIONREPOSITORY_H
56class EXPCL_DIRECT_DISTRIBUTED CConnectionRepository {
59 bool threaded_net =
false);
60 ~CConnectionRepository();
90 INLINE
void set_python_repository(PyObject *python_repository);
94 BLOCKING
void set_connection_http(HTTPChannel *channel);
95 BLOCKING SocketStream *get_stream();
98 BLOCKING
bool try_connect_net(
const URLSpec &url);
105#ifdef WANT_NATIVE_NET
106 BLOCKING
bool connect_native(
const URLSpec &url);
110#ifdef SIMULATE_NETWORK_DELAY
111 BLOCKING
void start_delay(
double min_delay,
double max_delay);
112 BLOCKING
void stop_delay();
120 BLOCKING INLINE
int get_msg_channel_count()
const;
141 BLOCKING
void bundle_msg(
const Datagram &dg);
144 BLOCKING
bool flush();
160 bool do_check_datagram();
161 bool handle_update_field();
162 bool handle_update_field_owner();
164 void describe_message(std::ostream &out,
const std::string &prefix,
171 PyObject *_python_repository;
175 SocketStream *_http_conn;
182 PT(Connection) _net_conn;
185#ifdef WANT_NATIVE_NET
191 bool _has_owner_view;
192 bool _handle_c_updates;
193 bool _client_datagram;
194 bool _handle_datagrams_internally;
195 int _tcp_header_size;
196 bool _simulated_disconnect;
204 std::vector<CHANNEL_TYPE> _msg_channels;
205 CHANNEL_TYPE _msg_sender;
206 unsigned int _msg_type;
208 static const std::string _overflow_event_name;
210 bool _want_message_bundling;
211 unsigned int _bundling_msgs;
212 typedef std::vector< std::string > BundledMsgVector;
213 BundledMsgVector _bundle_msgs;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
float get_time_warning() const
Returns the current setting of the time_warning field.
bool get_handle_c_updates() const
Returns true if this repository will process distributed updates internally in C++ code,...
void set_handle_datagrams_internally(bool handle_datagrams_internally)
Sets the handle_datagrams_internally flag.
bool flush()
Sends the most recently queued data now.
void abandon_message_bundles()
throw out any msgs that have been queued up for message bundles
DCFile & get_dc_file()
Returns the DCFile object associated with this repository.
void get_datagram_iterator(DatagramIterator &di)
Fills the DatagramIterator object with the iterator for the datagram most recently retrieved by check...
CHANNEL_TYPE get_msg_channel(int offset=0) const
Returns the channel(s) to which the current message was sent, according to the datagram headers.
unsigned int get_msg_type() const
Returns the security code associated with the current message, according to the datagram headers.
void set_in_quiet_zone(bool flag)
Enables/disables quiet zone mode.
void set_simulated_disconnect(bool simulated_disconnect)
Sets the simulated disconnect flag.
bool has_owner_view() const
Returns true if this repository can have 'owner' views of distributed objects.
void set_client_datagram(bool client_datagram)
Sets the client_datagram flag.
bool get_client_datagram() const
Returns the client_datagram flag.
bool is_bundling_messages() const
Returns true if repository is queueing outgoing messages into a message bundle.
void toggle_verbose()
Toggles the current setting of the verbose flag.
void set_verbose(bool verbose)
Directly sets the verbose flag.
void set_time_warning(float time_warning)
Directly sets the time_warning field.
bool get_want_message_bundling() const
Returns true if message bundling enabled.
CHANNEL_TYPE get_msg_sender() const
Returns the sender ID of the current message, according to the datagram headers.
void disconnect()
Closes the connection to the server.
void get_datagram(Datagram &dg)
Fills the datagram object with the datagram most recently retrieved by check_datagram().
bool send_datagram(const Datagram &dg)
Queues the indicated datagram for sending to the server.
void shutdown()
May be called at application shutdown to ensure all threads are cleaned up.
static const std::string & get_overflow_event_name()
Returns event string that will be thrown if the datagram reader queue overflows.
bool get_in_quiet_zone() const
Returns true if repository is in quiet zone mode.
void set_want_message_bundling(bool flag)
Enable/disable outbound message bundling.
void set_handle_c_updates(bool handle_c_updates)
Set true to specify this repository should process distributed updates internally in C++ code,...
void set_tcp_header_size(int tcp_header_size)
Sets the header size of TCP packets.
int get_tcp_header_size() const
Returns the current setting of TCP header size.
bool check_datagram()
Returns true if a new datagram is available, false otherwise.
bool consider_flush()
Sends the most recently queued data if enough time has elapsed.
bool get_simulated_disconnect() const
Returns the simulated disconnect flag.
bool get_handle_datagrams_internally() const
Returns the handle_datagrams_internally flag.
void send_message_bundle(unsigned int channel, unsigned int sender_channel)
Send network messages queued up since startMessageBundle was called.
bool get_verbose() const
Returns the current setting of the verbose flag.
void start_message_bundle()
Send a set of messages to the state server that will be processed atomically.
This class handles threaded delivery of datagrams to various TCP or UDP sockets.
Represents the complete list of Distributed Class descriptions as read from a .dc file.
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
A lightweight class that represents a single element that may be timed and/or counted via stats.
This flavor of ConnectionManager will queue up all of the reset-connection messages from the Connecti...
This flavor of ConnectionReader will read from its sockets and queue up all of the datagrams read for...
A container for a URL, e.g.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool is_connected(MObject &node, const string &attribute_name)
Returns true if the named connection exists on the node and is connected to anything,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.