|
Document of c-modernization-kit (porter) 1.0.0
|
potrCloseService 関数の実装。 More...
#include <stdlib.h>#include <string.h>#include <inttypes.h>#include <arpa/inet.h>#include <netinet/in.h>#include <sys/socket.h>#include <unistd.h>#include <porter_const.h>#include <porter.h>#include "../potrContext.h"#include "../potrPeerTable.h"#include "../thread/potrRecvThread.h"#include "../thread/potrHealthThread.h"#include "../thread/potrConnectThread.h"#include "../infra/potrSendQueue.h"#include "../thread/potrSendThread.h"#include "../protocol/packet.h"#include "../protocol/window.h"#include "../util/potrIpAddr.h"#include "../infra/potrLog.h"#include "../infra/crypto/crypto.h"Go to the source code of this file.
Functions | |
| static void | send_fin (struct PotrContext_ *ctx) |
| POTR_EXPORT int POTR_API | potrCloseService (PotrHandle handle) |
| サービスを閉じます。 | |
potrCloseService 関数の実装。
Definition in file potrCloseService.c.
|
static |
Definition at line 45 of file potrCloseService.c.
References PotrContext_::dest_addr, PotrServiceDef::encrypt_enabled, PotrServiceDef::encrypt_key, PotrPacket::flags, PotrContext_::n_path, packet_build_fin(), PACKET_HEADER_SIZE, packet_wire_size(), PotrPacket::payload_len, POTR_CRYPTO_NONCE_SIZE, POTR_CRYPTO_TAG_SIZE, potr_encrypt(), POTR_FLAG_ENCRYPTED, POTR_INVALID_SOCKET, POTR_SUCCESS, PotrContext_::service, PotrPacketSessionHdr::service_id, PotrServiceDef::service_id, PotrContext_::session_id, PotrPacket::session_id, PotrPacketSessionHdr::session_id, PotrContext_::session_tv_nsec, PotrPacketSessionHdr::session_tv_nsec, PotrContext_::session_tv_sec, PotrPacketSessionHdr::session_tv_sec, and PotrContext_::sock.
Referenced by potrCloseService().
| POTR_EXPORT int POTR_API potrCloseService | ( | PotrHandle | handle | ) |
サービスを閉じます。
| [in] | handle | potrOpenService() で取得したセッションハンドル。 |
受信スレッドを停止し、ソケットをクローズしてリソースを解放します。
マルチキャストの場合はグループから離脱します。
本関数呼び出し後、handle は無効となります。
Definition at line 120 of file potrCloseService.c.
References comm_recv_thread_stop(), PotrContext_::compress_buf, PotrContext_::crypto_buf, PotrContext_::frag_buf, PotrContext_::health_mutex, PotrContext_::health_running, PotrContext_::health_wakeup, PotrContext_::is_multi_peer, PotrServiceDef::multicast_group, PotrContext_::n_path, parse_ipv4_addr(), peer_table_destroy(), PotrContext_::peers, POTR_API, potr_connect_thread_stop(), POTR_ERROR, POTR_EXPORT, potr_health_thread_stop(), POTR_INVALID_SOCKET, potr_is_tcp_type(), POTR_LOG, POTR_MAX_PATH, potr_raw_base_type(), POTR_ROLE_SENDER, potr_send_queue_destroy(), potr_send_queue_wait_drained(), potr_send_thread_stop(), POTR_SUCCESS, POTR_TRACE_ERROR, POTR_TRACE_INFO, POTR_TRACE_VERBOSE, POTR_TYPE_MULTICAST, POTR_TYPE_TCP_BIDIR, PotrContext_::recv_buf, PotrContext_::recv_window, PotrContext_::recv_window_mutex, PotrContext_::role, PotrContext_::running, send_fin(), PotrContext_::send_queue, PotrContext_::send_thread_running, PotrContext_::send_window, PotrContext_::send_wire_buf, PotrContext_::service, PotrServiceDef::service_id, PotrContext_::sock, PotrContext_::src_addr_resolved, PotrContext_::tcp_send_mutex, PotrContext_::tcp_state_cv, PotrContext_::tcp_state_mutex, PotrServiceDef::type, and window_destroy().
Referenced by main().