MCPcopy Create free account
hub / github.com/Haivision/srt / StateToStr

Function StateToStr

test/test_socket_options.cpp:744–759  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

742#endif
743
744const char* StateToStr(SRT_SOCKSTATUS st)
745{
746 std::map<SRT_SOCKSTATUS, const char* const> st_to_str = {
747 { SRTS_INIT, "SRTS_INIT" },
748 { SRTS_OPENED, "SRTS_OPENED" },
749 { SRTS_LISTENING, "SRTS_LISTENING" },
750 { SRTS_CONNECTING, "SRTS_CONNECTING" },
751 { SRTS_CONNECTED, "SRTS_CONNECTED" },
752 { SRTS_BROKEN, "SRTS_BROKEN" },
753 { SRTS_CLOSING, "SRTS_CLOSING" },
754 { SRTS_CLOSED, "SRTS_CLOSED" },
755 { SRTS_NONEXIST, "SRTS_NONEXIST" }
756 };
757
758 return st_to_str.find(st) != st_to_str.end() ? st_to_str.at(st) : "INVALID";
759}
760
761#if 0
762// No socket option can be set in blocking mode because m_ConnectionLock is required by both srt_setsockopt and srt_connect

Callers 1

TEST_FFunction · 0.85

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected