local_address.ipaddr(), 0, 0,
kIceUfrag1, kIcePwd1,
server_address, credentials));
+ // Set ICE protocol type to ICEPROTO_RFC5245, as port by default will be
+ // in Hybrid mode. Protocol type is necessary to send correct type STUN ping
+ // messages.
+ // This TURN port will be the controlling.
+ turn_port_->SetIceProtocolType(cricket::ICEPROTO_RFC5245);
+ turn_port_->SetIceRole(cricket::ICEROLE_CONTROLLING);
turn_port_->SignalPortComplete.connect(this,
&TurnPortTest::OnTurnPortComplete);
turn_port_->SignalPortError.connect(this,
udp_port_.reset(UDPPort::Create(main_, &socket_factory_, &network_,
kLocalAddr2.ipaddr(), 0, 0,
kIceUfrag2, kIcePwd2));
+ // Set protocol type to RFC5245, as turn port is also in same mode.
+ // UDP port will be controlled.
+ udp_port_->SetIceProtocolType(cricket::ICEPROTO_RFC5245);
+ udp_port_->SetIceRole(cricket::ICEROLE_CONTROLLED);
udp_port_->SignalPortComplete.connect(
this, &TurnPortTest::OnUdpPortComplete);
}
for (size_t j = 0; j < i + 1; ++j) {
buf[j] = 0xFF - j;
}
- conn1->Send(buf, i + 1, talk_base::DSCP_NO_CHANGE);
- conn2->Send(buf, i + 1, talk_base::DSCP_NO_CHANGE);
+ conn1->Send(buf, i + 1, options);
+ conn2->Send(buf, i + 1, options);
main_->ProcessMessages(0);
}
bool test_finish_;
std::vector<talk_base::Buffer> turn_packets_;
std::vector<talk_base::Buffer> udp_packets_;
+ talk_base::PacketOptions options;
};
// Do a normal TURN allocation.