mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
SRT: Upgrade libsrt from 1.4.1 to 1.5.1. v6.0.12 (#3362)
Co-authored-by: winlin <winlin@vip.126.com>
This commit is contained in:
parent
7a56208f2f
commit
fe086dfc31
143 changed files with 38185 additions and 15108 deletions
63
trunk/3rdparty/srt-1-fit/srtcore/group_common.cpp
vendored
Normal file
63
trunk/3rdparty/srt-1-fit/srtcore/group_common.cpp
vendored
Normal file
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
* SRT - Secure, Reliable, Transport
|
||||
* Copyright (c) 2021 Haivision Systems Inc.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
Written by
|
||||
Haivision Systems Inc.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "platform_sys.h"
|
||||
|
||||
#include "group_common.h"
|
||||
#include "api.h"
|
||||
|
||||
namespace srt
|
||||
{
|
||||
namespace groups
|
||||
{
|
||||
|
||||
SocketData prepareSocketData(CUDTSocket* s)
|
||||
{
|
||||
// This uses default SRT_GST_BROKEN because when the group operation is done,
|
||||
// then the SRT_GST_IDLE state automatically turns into SRT_GST_RUNNING. This is
|
||||
// recognized as an initial state of the fresh added socket to the group,
|
||||
// so some "initial configuration" must be done on it, after which it's
|
||||
// turned into SRT_GST_RUNNING, that is, it's treated as all others. When
|
||||
// set to SRT_GST_BROKEN, this socket is disregarded. This socket isn't cleaned
|
||||
// up, however, unless the status is simultaneously SRTS_BROKEN.
|
||||
|
||||
// The order of operations is then:
|
||||
// - add the socket to the group in this "broken" initial state
|
||||
// - connect the socket (or get it extracted from accept)
|
||||
// - update the socket state (should be SRTS_CONNECTED)
|
||||
// - once the connection is established (may take time with connect), set SRT_GST_IDLE
|
||||
// - the next operation of send/recv will automatically turn it into SRT_GST_RUNNING
|
||||
SocketData sd = {
|
||||
s->m_SocketID,
|
||||
s,
|
||||
-1,
|
||||
SRTS_INIT,
|
||||
SRT_GST_BROKEN,
|
||||
SRT_GST_BROKEN,
|
||||
-1,
|
||||
-1,
|
||||
sockaddr_any(),
|
||||
sockaddr_any(),
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
0, // weight
|
||||
0 // pktSndDropTotal
|
||||
};
|
||||
return sd;
|
||||
}
|
||||
|
||||
} // namespace groups
|
||||
} // namespace srt
|
Loading…
Add table
Add a link
Reference in a new issue