| 742 | #endif |
| 743 | |
| 744 | const 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 |