mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-26 21:24:16 +00:00
FS-6735
This commit is contained in:
1 parent
b6dc4a6c11
commit
f4a04e65f2
3 files changed
+32
No files matched your search
@@ -789,6 +789,34 @@ SWITCH_DECLARE(switch_status_t) switch_sockaddr_info_get(switch_sockaddr_t ** sa
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_opt_set(switch_socket_t *sock, int32_t opt, int32_t on)
|
||||
{
|
||||
if (opt == SWITCH_SO_TCP_KEEPIDLE) {
|
||||
int r = -10;
|
||||
|
||||
#if defined(TCP_KEEPIDLE)
|
||||
r = setsockopt(jsock->client_socket, SOL_TCP, TCP_KEEPIDLE, (void *)&on, sizeof(on));
|
||||
#endif
|
||||
if (r == -10) {
|
||||
return SWITCH_STATUS_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
return r ? SWITCH_STATUS_FALSE : SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (opt == SWITCH_SO_TCP_KEEPINTVL) {
|
||||
int r = -10;
|
||||
|
||||
#if defined(TCP_KEEPINTVL)
|
||||
r = setsockopt(jsock->client_socket, SOL_TCP, TCP_KEEPINTVL, (void *)&on, sizeof(on));
|
||||
#endif
|
||||
|
||||
if (r == -10) {
|
||||
return SWITCH_STATUS_NOTIMPL;
|
||||
}
|
||||
|
||||
return r ? SWITCH_STATUS_FALSE : SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
return apr_socket_opt_set(sock, opt, on);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user