Lines Matching refs:fds
53 (void)zsock_close(sh_telnet->fds[SOCK_ID_CLIENT].fd); in telnet_end_client_connection()
55 sh_telnet->fds[SOCK_ID_CLIENT].fd = -1; in telnet_end_client_connection()
61 ret = net_socket_service_register(&telnet_server, sh_telnet->fds, in telnet_end_client_connection()
62 ARRAY_SIZE(sh_telnet->fds), NULL); in telnet_end_client_connection()
70 if (sh_telnet->fds[SOCK_ID_CLIENT].fd < 0) { in telnet_command_send_reply()
77 ret = zsock_send(sh_telnet->fds[SOCK_ID_CLIENT].fd, msg, len, 0); in telnet_command_send_reply()
194 if (sh_telnet->fds[SOCK_ID_CLIENT].fd < 0) { in telnet_send()
199 ret = zsock_send(sh_telnet->fds[SOCK_ID_CLIENT].fd, msg, len, in telnet_send()
389 if (sh_telnet->fds[SOCK_ID_IPV4_LISTEN].fd >= 0) { in telnet_restart_server()
390 (void)zsock_close(sh_telnet->fds[SOCK_ID_IPV4_LISTEN].fd); in telnet_restart_server()
391 sh_telnet->fds[SOCK_ID_IPV4_LISTEN].fd = -1; in telnet_restart_server()
394 if (sh_telnet->fds[SOCK_ID_IPV6_LISTEN].fd >= 0) { in telnet_restart_server()
395 (void)zsock_close(sh_telnet->fds[SOCK_ID_IPV6_LISTEN].fd); in telnet_restart_server()
396 sh_telnet->fds[SOCK_ID_IPV6_LISTEN].fd = -1; in telnet_restart_server()
399 if (sh_telnet->fds[SOCK_ID_CLIENT].fd >= 0) { in telnet_restart_server()
400 (void)zsock_close(sh_telnet->fds[SOCK_ID_CLIENT].fd); in telnet_restart_server()
401 sh_telnet->fds[SOCK_ID_CLIENT].fd = -1; in telnet_restart_server()
424 if (sh_telnet->fds[SOCK_ID_CLIENT].fd > 0) { in telnet_accept()
431 sh_telnet->fds[SOCK_ID_CLIENT].fd = sock; in telnet_accept()
432 sh_telnet->fds[SOCK_ID_CLIENT].events = ZSOCK_POLLIN; in telnet_accept()
437 ret = net_socket_service_register(&telnet_server, sh_telnet->fds, in telnet_accept()
438 ARRAY_SIZE(sh_telnet->fds), NULL); in telnet_accept()
441 sh_telnet->fds[SOCK_ID_CLIENT].fd = -1; in telnet_accept()
480 if (evt->event.fd == sh_telnet->fds[SOCK_ID_CLIENT].fd) { in telnet_server_cb()
492 if (evt->event.fd == sh_telnet->fds[SOCK_ID_IPV4_LISTEN].fd) { in telnet_server_cb()
493 telnet_accept(&sh_telnet->fds[SOCK_ID_IPV4_LISTEN]); in telnet_server_cb()
495 } else if (evt->event.fd == sh_telnet->fds[SOCK_ID_IPV6_LISTEN].fd) { in telnet_server_cb()
496 telnet_accept(&sh_telnet->fds[SOCK_ID_IPV6_LISTEN]); in telnet_server_cb()
498 } else if (evt->event.fd == sh_telnet->fds[SOCK_ID_CLIENT].fd) { in telnet_server_cb()
499 telnet_recv(&sh_telnet->fds[SOCK_ID_CLIENT]); in telnet_server_cb()
566 ret = telnet_setup_server(&ctx->fds[SOCK_ID_IPV4_LISTEN], in telnet_init()
581 ret = telnet_setup_server(&ctx->fds[SOCK_ID_IPV6_LISTEN], in telnet_init()
589 ret = net_socket_service_register(&telnet_server, ctx->fds, in telnet_init()
590 ARRAY_SIZE(ctx->fds), NULL); in telnet_init()
601 if (ctx->fds[SOCK_ID_IPV4_LISTEN].fd >= 0) { in telnet_init()
602 (void)zsock_close(ctx->fds[SOCK_ID_IPV4_LISTEN].fd); in telnet_init()
603 ctx->fds[SOCK_ID_IPV4_LISTEN].fd = -1; in telnet_init()
606 if (ctx->fds[SOCK_ID_IPV6_LISTEN].fd >= 0) { in telnet_init()
607 (void)zsock_close(ctx->fds[SOCK_ID_IPV6_LISTEN].fd); in telnet_init()
608 ctx->fds[SOCK_ID_IPV6_LISTEN].fd = -1; in telnet_init()
626 for (int i = 0; i < ARRAY_SIZE(sh_telnet->fds); i++) { in init()
627 sh_telnet->fds[i].fd = -1; in init()
676 if (sh_telnet->fds[SOCK_ID_CLIENT].fd < 0 || sh_telnet->output_lock) { in telnet_write()
744 if (sh_telnet->fds[SOCK_ID_CLIENT].fd < 0) { in telnet_read()