srt handshake packet send 3 times

This commit is contained in:
xiongguangjie 2022-08-27 13:25:23 +08:00
parent beb6383e72
commit 602c8e068b

View File

@ -143,7 +143,9 @@ void SrtTransport::handleHandshakeInduction(HandshakePacket &pkt, struct sockadd
if (_handleshake_res) { if (_handleshake_res) {
if(isSameCon(pkt)){ if(isSameCon(pkt)){
TraceL << getIdentifier() <<" Induction repeate "<<SockUtil::inet_ntoa((struct sockaddr *)addr) << ":" << SockUtil::inet_port((struct sockaddr *)addr); TraceL << getIdentifier() <<" Induction repeate "<<SockUtil::inet_ntoa((struct sockaddr *)addr) << ":" << SockUtil::inet_port((struct sockaddr *)addr);
sendControlPacket(_handleshake_res, true); for(int i=0;i<3;++i){
sendControlPacket(_handleshake_res, true);
}
}else{ }else{
TraceL << getIdentifier() <<" new connection fron client "<<SockUtil::inet_ntoa((struct sockaddr *)addr) << ":" << SockUtil::inet_port((struct sockaddr *)addr); TraceL << getIdentifier() <<" new connection fron client "<<SockUtil::inet_ntoa((struct sockaddr *)addr) << ":" << SockUtil::inet_port((struct sockaddr *)addr);
onShutdown(SockException(Err_other, "client new connection")); onShutdown(SockException(Err_other, "client new connection"));
@ -179,7 +181,9 @@ void SrtTransport::handleHandshakeInduction(HandshakePacket &pkt, struct sockadd
res->storeToData(); res->storeToData();
registerSelfHandshake(); registerSelfHandshake();
sendControlPacket(res, true); for(int i=0;i<3;++i){
sendControlPacket(res, true);
}
} }
void SrtTransport::handleHandshakeConclusion(HandshakePacket &pkt, struct sockaddr_storage *addr) { void SrtTransport::handleHandshakeConclusion(HandshakePacket &pkt, struct sockaddr_storage *addr) {
@ -240,7 +244,9 @@ void SrtTransport::handleHandshakeConclusion(HandshakePacket &pkt, struct sockad
_handleshake_res = res; _handleshake_res = res;
unregisterSelfHandshake(); unregisterSelfHandshake();
registerSelf(); registerSelf();
sendControlPacket(res, true); for(int i=0;i<3;++i){
sendControlPacket(res, true);
}
TraceL << " buf size = " << res->max_flow_window_size << " init seq =" << _init_seq_number TraceL << " buf size = " << res->max_flow_window_size << " init seq =" << _init_seq_number
<< " latency=" << delay; << " latency=" << delay;
_recv_buf = std::make_shared<PacketRecvQueue>(getPktBufSize(), _init_seq_number, delay * 1e3,srt_flag); _recv_buf = std::make_shared<PacketRecvQueue>(getPktBufSize(), _init_seq_number, delay * 1e3,srt_flag);
@ -251,7 +257,9 @@ void SrtTransport::handleHandshakeConclusion(HandshakePacket &pkt, struct sockad
} else { } else {
if(isSameCon(pkt)){ if(isSameCon(pkt)){
TraceL << getIdentifier() <<" CONCLUSION repeate "<<SockUtil::inet_ntoa((struct sockaddr *)addr) << ":" << SockUtil::inet_port((struct sockaddr *)addr); TraceL << getIdentifier() <<" CONCLUSION repeate "<<SockUtil::inet_ntoa((struct sockaddr *)addr) << ":" << SockUtil::inet_port((struct sockaddr *)addr);
sendControlPacket(_handleshake_res, true); for(int i=0;i<3;++i){
sendControlPacket(_handleshake_res, true);
}
}else{ }else{
TraceL << getIdentifier() <<" new connection fron client "<<SockUtil::inet_ntoa((struct sockaddr *)addr) << ":" << SockUtil::inet_port((struct sockaddr *)addr); TraceL << getIdentifier() <<" new connection fron client "<<SockUtil::inet_ntoa((struct sockaddr *)addr) << ":" << SockUtil::inet_port((struct sockaddr *)addr);
onShutdown(SockException(Err_other, "client new connection")); onShutdown(SockException(Err_other, "client new connection"));