|
Document of c-modernization-kit (porter) 1.0.0
|
potrDisconnectPeer 関数の実装。 More...
#include <inttypes.h>#include <porter_const.h>#include <porter.h>#include "../potrContext.h"#include "../potrPeerTable.h"#include "../infra/potrLog.h"#include <pthread.h>Go to the source code of this file.
Macros | |
| #define | POTR_MUTEX_LOCK_LOCAL(m) |
| #define | POTR_MUTEX_UNLOCK_LOCAL(m) |
Typedefs | |
| typedef pthread_mutex_t | PotrMutexLocal |
Functions | |
| POTR_EXPORT int POTR_API | potrDisconnectPeer (PotrHandle handle, PotrPeerId peer_id) |
| 指定ピアを切断します (N:1 モード専用)。 | |
potrDisconnectPeer 関数の実装。
Definition in file potrDisconnectPeer.c.
| #define POTR_MUTEX_LOCK_LOCAL | ( | m | ) |
Definition at line 25 of file potrDisconnectPeer.c.
Referenced by potrDisconnectPeer().
| #define POTR_MUTEX_UNLOCK_LOCAL | ( | m | ) |
Definition at line 26 of file potrDisconnectPeer.c.
Referenced by potrDisconnectPeer().
| typedef pthread_mutex_t PotrMutexLocal |
Definition at line 24 of file potrDisconnectPeer.c.
| POTR_EXPORT int POTR_API potrDisconnectPeer | ( | PotrHandle | handle, |
| PotrPeerId | peer_id ) |
指定ピアを切断します (N:1 モード専用)。
| [in] | handle | potrOpenService() で取得したセッションハンドル。 |
| [in] | peer_id | 切断するピアの識別子 (POTR_PEER_NA および POTR_PEER_ALL 以外)。 |
指定したピアへ FIN パケットを送信し、ピアのリソースを解放します。
切断完了後に POTR_EVENT_DISCONNECTED コールバックが発火します。
N:1 モード (unicast_bidir かつ src 情報省略) 専用です。
1:1 モードおよびその他の通信種別では POTR_ERROR を返します。
Definition at line 35 of file potrDisconnectPeer.c.
References PotrContext_::callback, PotrPeerContext_::health_alive, PotrContext_::is_multi_peer, peer_find_by_id(), peer_free(), PotrPeerContext_::peer_id, peer_send_fin(), PotrContext_::peers_mutex, POTR_API, POTR_ERROR, POTR_EVENT_DISCONNECTED, POTR_EXPORT, POTR_LOG, POTR_MUTEX_LOCK_LOCAL, POTR_MUTEX_UNLOCK_LOCAL, POTR_PEER_ALL, POTR_PEER_NA, POTR_SUCCESS, POTR_TRACE_ERROR, POTR_TRACE_INFO, PotrContext_::service, and PotrServiceDef::service_id.