Lines Matching refs:sock_fd
137 if (client_ctx->sock_fd < 0) { in lwm2m_open_socket()
141 client_ctx->sock_fd = zsock_socket(client_ctx->remote_addr.sa_family, in lwm2m_open_socket()
144 client_ctx->sock_fd = in lwm2m_open_socket()
149 if (client_ctx->sock_fd < 0) { in lwm2m_open_socket()
164 if (client_ctx->sock_fd >= 0) { in lwm2m_close_socket()
165 int ret = zsock_close(client_ctx->sock_fd); in lwm2m_close_socket()
174 client_ctx->sock_fd = -1; in lwm2m_close_socket()
189 if (client_ctx->sock_fd >= 0 && !client_ctx->connection_suspended) { in lwm2m_socket_suspend()
190 int socket_temp_id = client_ctx->sock_fd; in lwm2m_socket_suspend()
193 client_ctx->sock_fd = -1; in lwm2m_socket_suspend()
197 client_ctx->sock_fd = socket_temp_id; in lwm2m_socket_suspend()
200 client_ctx->set_socket_state(client_ctx->sock_fd, in lwm2m_socket_suspend()
548 sock_fds[sock_nfds].fd = ctx->sock_fd; in lwm2m_socket_add()
563 sock_fds[i].fd = ctx->sock_fd; in lwm2m_socket_update()
678 ctx->set_socket_state(ctx->sock_fd, LWM2M_SOCKET_STATE_ONGOING); in hint_socket_state()
680 ctx->set_socket_state(ctx->sock_fd, LWM2M_SOCKET_STATE_ONE_RESPONSE); in hint_socket_state()
682 ctx->set_socket_state(ctx->sock_fd, LWM2M_SOCKET_STATE_LAST); in hint_socket_state()
685 ctx->set_socket_state(ctx->sock_fd, LWM2M_SOCKET_STATE_NO_DATA); in hint_socket_state()
697 len = zsock_recvfrom(client_ctx->sock_fd, in_buf, sizeof(in_buf) - 1, ZSOCK_MSG_DONTWAIT, in socket_recv_message()
749 rc = zsock_send(msg->ctx->sock_fd, msg->cpkt.data, msg->cpkt.offset, 0); in socket_send_message()
881 if (sock_ctx[i] != NULL && sock_ctx[i]->sock_fd < 0) { in socket_loop()
1072 ret = zsock_setsockopt(ctx->sock_fd, SOL_TLS, TLS_SEC_TAG_LIST, tls_tag_list, in lwm2m_set_default_sockopt()
1083 ret = zsock_setsockopt(ctx->sock_fd, SOL_TLS, TLS_SESSION_CACHE, in lwm2m_set_default_sockopt()
1095 ret = zsock_setsockopt(ctx->sock_fd, SOL_TLS, TLS_DTLS_CID, &cid, in lwm2m_set_default_sockopt()
1112 ret = zsock_setsockopt(ctx->sock_fd, SOL_TLS, TLS_HOSTNAME, in lwm2m_set_default_sockopt()
1125 ret = zsock_setsockopt(ctx->sock_fd, SOL_TLS, TLS_PEER_VERIFY, &verify, in lwm2m_set_default_sockopt()
1135 ret = zsock_setsockopt(ctx->sock_fd, SOL_TLS, TLS_PEER_VERIFY, &verify, in lwm2m_set_default_sockopt()
1144 ret = zsock_setsockopt(ctx->sock_fd, SOL_TLS, TLS_CIPHERSUITE_LIST, in lwm2m_set_default_sockopt()
1151 ret = zsock_setsockopt(ctx->sock_fd, SOL_TLS, TLS_CIPHERSUITE_LIST, in lwm2m_set_default_sockopt()
1189 if (client_ctx->sock_fd < 0) { in lwm2m_socket_start()
1214 if (zsock_connect(client_ctx->sock_fd, &client_ctx->remote_addr, addr_len) < 0) { in lwm2m_socket_start()
1220 flags = zsock_fcntl(client_ctx->sock_fd, F_GETFL, 0); in lwm2m_socket_start()
1226 ret = zsock_fcntl(client_ctx->sock_fd, F_SETFL, flags | O_NONBLOCK); in lwm2m_socket_start()
1233 LOG_INF("Connected, sock id %d", client_ctx->sock_fd); in lwm2m_socket_start()
1242 int sock_fd = client_ctx->sock_fd; in lwm2m_socket_close() local
1245 client_ctx->sock_fd = -1; in lwm2m_socket_close()
1246 if (sock_fd >= 0) { in lwm2m_socket_close()
1247 return zsock_close(sock_fd); in lwm2m_socket_close()