| 532 | // (also useful for applications) |
| 533 | |
| 534 | std::string SockStatusStr(SRT_SOCKSTATUS s) |
| 535 | { |
| 536 | if (int(s) < int(SRTS_INIT) || int(s) > int(SRTS_NONEXIST)) |
| 537 | return "???"; |
| 538 | |
| 539 | static struct AutoMap |
| 540 | { |
| 541 | // Values start from 1, so do -1 to avoid empty cell |
| 542 | std::string names[int(SRTS_NONEXIST)-1+1]; |
| 543 | |
| 544 | AutoMap() |
| 545 | { |
| 546 | #define SINI(statename) names[SRTS_##statename-1] = #statename |
| 547 | SINI(INIT); |
| 548 | SINI(OPENED); |
| 549 | SINI(LISTENING); |
| 550 | SINI(CONNECTING); |
| 551 | SINI(CONNECTED); |
| 552 | SINI(BROKEN); |
| 553 | SINI(CLOSING); |
| 554 | SINI(CLOSED); |
| 555 | SINI(NONEXIST); |
| 556 | #undef SINI |
| 557 | } |
| 558 | } names; |
| 559 | |
| 560 | return names.names[int(s)-1]; |
| 561 | } |
| 562 | |
| 563 | #if ENABLE_BONDING |
| 564 | std::string MemberStatusStr(SRT_MEMBERSTATUS s) |
no outgoing calls