Overte C++ Documentation
SocketType.h
1 //
2 // SocketType.h
3 // libraries/networking/src
4 //
5 // Created by David Rowe on 17 May 2021.
6 // Copyright 2021 Vircadia contributors.
7 //
8 // Handles UDP and WebRTC sockets in parallel.
9 //
10 // Distributed under the Apache License, Version 2.0.
11 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
12 //
13 
14 #ifndef overte_SocketType_h
15 #define overte_SocketType_h
16 
19 
20 
22 enum class SocketType : uint8_t {
23  Unknown,
24  UDP,
25  WebRTC
26 };
27 
28 class SocketTypeToString {
29 public:
33  static QString socketTypeToString (SocketType socketType) {
34  static QStringList SOCKET_TYPE_STRINGS { "Unknown", "UDP", "WebRTC" };
35  return SOCKET_TYPE_STRINGS[(int)socketType];
36  }
37 };
38 
40 
41 #endif // overte_SocketType_h
SocketType
The types of network socket.
Definition: SocketType.h:22
@ Unknown
Socket type unknown or not set.
@ WebRTC
WebRTC socket. A WebRTC data channel presented as a UDP-style socket.
@ UDP
UDP socket.