4 #ifndef __KINESIS_VIDEO_WEBRTC_SOCKET_CONNECTION__
5 #define __KINESIS_VIDEO_WEBRTC_SOCKET_CONNECTION__
13 #define SOCKET_SEND_RETRY_TIMEOUT_MILLI_SECOND 500
14 #define MAX_SOCKET_WRITE_RETRY 3
16 #define CLOSE_SOCKET_IF_CANT_RETRY(e, ps) \
17 if ((e) != EAGAIN && (e) != EWOULDBLOCK && (e) != EINTR && (e) != EINPROGRESS && (e) != EPERM && (e) != EALREADY && (e) != ENETUNREACH) { \
18 DLOGD("Close socket %d", (ps)->localSocket); \
19 ATOMIC_STORE_BOOL(&(ps)->connectionClosed, TRUE); \
KVS_IP_FAMILY_TYPE
Definition: Include_i.h:94
struct KvsIpAddress * PKvsIpAddress
KVS_SOCKET_PROTOCOL
Definition: Network.h:48
STATUS socketSendDataWithRetry(PSocketConnection, PBYTE, UINT32, PKvsIpAddress, PUINT32)
Definition: SocketConnection.c:353
BOOL socketConnectionIsConnected(PSocketConnection)
Definition: SocketConnection.c:303
STATUS createSocketConnection(KVS_IP_FAMILY_TYPE, KVS_SOCKET_PROTOCOL, PKvsIpAddress, PKvsIpAddress, UINT64, ConnectionDataAvailableFunc, UINT32, PSocketConnection *)
Definition: SocketConnection.c:7
STATUS socketConnectionSendData(PSocketConnection, PBYTE, UINT32, PKvsIpAddress)
Definition: SocketConnection.c:205
VOID socketConnectionTlsSessionOnStateChange(UINT64, TLS_SESSION_STATE)
Definition: SocketConnection.c:143
STATUS(* ConnectionDataAvailableFunc)(UINT64, struct __SocketConnection *, PBYTE, UINT32, PKvsIpAddress, PKvsIpAddress)
Definition: SocketConnection.h:22
STATUS socketConnectionReadData(PSocketConnection, PBYTE, UINT32, PUINT32)
Definition: SocketConnection.c:243
STATUS socketConnectionTlsSessionOutBoundPacket(UINT64, PBYTE, UINT32)
Definition: SocketConnection.c:130
STATUS socketConnectionClosed(PSocketConnection)
Definition: SocketConnection.c:273
BOOL socketConnectionIsClosed(PSocketConnection)
Definition: SocketConnection.c:294
struct __SocketConnection * PSocketConnection
Definition: SocketConnection.h:48
STATUS socketConnectionInitSecureConnection(PSocketConnection, BOOL)
Definition: SocketConnection.c:170
STATUS freeSocketConnection(PSocketConnection *)
Definition: SocketConnection.c:72
TLS_SESSION_STATE
Definition: Tls.h:10
Definition: Include_i.h:99
Definition: SocketConnection.h:25
INT32 localSocket
Definition: SocketConnection.h:34
ConnectionDataAvailableFunc dataAvailableCallbackFn
Definition: SocketConnection.h:44
volatile ATOMIC_BOOL connectionClosed
Definition: SocketConnection.h:27
volatile ATOMIC_BOOL receiveData
Definition: SocketConnection.h:29
MUTEX lock
Definition: SocketConnection.h:42
UINT64 tlsHandshakeStartTime
Definition: SocketConnection.h:46
KVS_SOCKET_PROTOCOL protocol
Definition: SocketConnection.h:35
UINT64 dataAvailableCallbackCustomData
Definition: SocketConnection.h:45
volatile ATOMIC_BOOL inUse
Definition: SocketConnection.h:32
KvsIpAddress peerIpAddr
Definition: SocketConnection.h:36
KvsIpAddress hostIpAddr
Definition: SocketConnection.h:37
BOOL secureConnection
Definition: SocketConnection.h:39
PTlsSession pTlsSession
Definition: SocketConnection.h:40