Lines Matching defs:connection

50 // well on a 28.8K modem, which is the slowest connection on which the voice
56 // If there is a current writable connection, then we will also try hard to
76 // Compare connection priority. Lower values get sorted last.
99 // Wraps the comparison connection into a less than operator that puts higher
120 // Should we bother checking for the last connection that last received
121 // data? It would help rendezvous on the connection that is also receiving
203 void P2PTransportChannel::AddConnection(Connection* connection) {
204 connections_.push_back(connection);
205 connection->set_remote_ice_mode(remote_ice_mode_);
206 connection->SignalReadPacket.connect(
208 connection->SignalReadyToSend.connect(
210 connection->SignalStateChange.connect(
212 connection->SignalDestroyed.connect(
214 connection->SignalUseCandidate.connect(
380 // Attempt to create a connection from this new port to all of the remote
526 // There shouldn't be an existing connection with this remote address.
528 // signals. In that case if the connection is already exists, we should
544 Connection* connection = port->CreateConnection(
546 if (!connection) {
554 AddConnection(connection);
555 connection->ReceivedPing();
562 // connection in question.
570 // shouldn't cause a new connection to fail
582 // connection in question.
610 // Now we have selected the best connection, time to prune other existing
630 // remote candidate. The return value is true if we created a connection from
653 // We either already have a connection for it, or we previously created one
664 // Add a new connection for this candidate to every port that allows such a
665 // connection (i.e., if they have compatible protocols) and that does not
666 // already have a connection to an equivalent candidate. We must be careful
668 // since that may be the only port that can create this connection.
691 // Setup a connection object for the local and remote candidate combination.
692 // And then listen to connection object for changes.
697 // Look for an existing connection with this remote address. If one is not
698 // found, then we can create a new connection for this address.
699 Connection* connection = port->GetConnection(remote_candidate.address());
700 if (connection != NULL) {
702 // connection; however, the other side can send a duplicate candidate.
703 if (!remote_candidate.IsEquivalent(connection->remote_candidate())) {
706 << connection->remote_candidate().ToString()
714 // Don't create connection if this is a candidate we received in a
719 connection = port->CreateConnection(remote_candidate, origin);
720 if (!connection)
723 AddConnection(connection);
725 LOG_J(LS_INFO, this) << "Created connection with origin=" << origin << ", ("
732 connection->ReceivedPing();
738 cricket::Connection* connection) const {
740 std::find(connections_.begin(), connections_.end(), connection);
819 // Send data to the other side, using our best connection.
843 // Gather connection infos.
848 Connection *connection = *it;
850 info.best_connection = (best_connection_ == connection);
852 (connection->read_state() == Connection::STATE_READABLE);
854 (connection->write_state() == Connection::STATE_WRITABLE);
856 (connection->write_state() == Connection::STATE_WRITE_TIMEOUT);
857 info.new_connection = !connection->reported();
858 connection->set_reported(true);
859 info.rtt = connection->rtt();
860 info.sent_total_bytes = connection->sent_total_bytes();
861 info.sent_bytes_second = connection->sent_bytes_second();
862 info.recv_total_bytes = connection->recv_total_bytes();
863 info.recv_bytes_second = connection->recv_bytes_second();
864 info.local_candidate = connection->local_candidate();
865 info.remote_candidate = connection->remote_candidate();
866 info.key = connection;
889 // Monitor connection states.
912 // Make sure the connection states are up-to-date since this affects how they
933 // Find the best alternative connection by sorting. It is important to note
959 // We can prune any connection for which there is a writable connection on
962 // we would prune out the current best connection). We leave connections on
1000 // state of any connection changes, so this is a good place to do this.
1005 // Track the best connection, and let listeners know
1013 LOG_J(LS_INFO, this) << "Previous best connection: "
1016 LOG_J(LS_INFO, this) << "New best connection: "
1020 LOG_J(LS_INFO, this) << "No best connection";
1074 // If we have a best connection, return it, otherwise return top one in the
1078 // If the best connection is on this network, then it wins.
1118 // Find the oldest pingable connection and have it do a ping.
1128 // Is the connection in a state for us to even consider pinging the other side?
1130 // An unconnected connection cannot be written to at all, so pinging is out
1142 // ones that do not have read timeout. A connection could be readable but
1150 // Returns the next pingable connection to ping. This will be the oldest
1151 // pingable connection unless we have a writable connection that is past the
1180 // a.1) |conn| is the best connection OR
1181 // a.2) there is no best connection OR
1182 // a.3) the best connection is unwritable OR
1203 // When a connection's state changes, we need to figure out who to use as
1204 // the best connection again. It could have become usable, or become unusable.
1205 void P2PTransportChannel::OnConnectionStateChange(Connection* connection) {
1208 // Update the best connection if the state change is from pending best
1209 // connection and role is controlled.
1211 if (connection == pending_best_connection_ && connection->writable()) {
1213 SwitchBestConnectionTo(connection);
1222 // When a connection is removed, edit it out, and then update our best
1223 // connection.
1224 void P2PTransportChannel::OnConnectionDestroyed(Connection* connection) {
1230 // Remove this connection from the list.
1232 std::find(connections_.begin(), connections_.end(), connection);
1236 LOG_J(LS_INFO, this) << "Removed connection ("
1239 if (pending_best_connection_ == connection) {
1243 // If this is currently the best connection, then we need to pick a new one.
1245 // best connection in order to avoid switching between fairly similar ones.
1246 // Since this connection is no longer an option, we can just set best to NULL
1247 // and re-choose a best assuming that there was no best connection.
1248 if (best_connection_ == connection) {
1257 // connection attempts.
1273 Connection *connection, const char *data, size_t len,
1278 if (!FindConnection(connection))
1285 void P2PTransportChannel::OnReadyToSend(Connection* connection) {
1286 if (connection == best_connection_ && writable()) {