Teonet library
0.4.7
|
Macros | |
#define | MODULE "async_module" |
#define | kev ((ksnetEvMgrClass*)(ke)) |
#define | MULTITHREADED() (kev->ta->f_multi_thread == MULTITHREAD) |
#define | NO_MULTITHREADED() (kev->ta->f_multi_thread == NO_MULTITHREAD) |
#define | SEND_CONDITION() ((ud->rv >= 0 || ud->rv == CHSQ_WRONG_PEER) && ud->rv < SEND_IF) |
#define | SET_TIMEOUT() |
#define | CHECK_RETRIVES 10 |
#define | LOCK_CV() pthread_mutex_lock(&kev->ta->cv_mutex); |
#define | UNLOCK_CV() pthread_mutex_unlock(&kev->ta->cv_mutex); |
#define | SEND_ASYNC(buf, buf_length) |
Typedefs | |
typedef struct async_data | async_data |
Enumerations | |
enum | CHECK_SEND_QUEUE { CHSQ_WRONG_REQUEST = -2, CHSQ_WRONG_PEER = -3, CHSQ_WRONG_ADDRESS = -4, CHSQ_TIMEOUT = -5 } |
enum | MULTITHREAD { NOT_DEFINED_MULTITHREAD = 0, MULTITHREAD = 1, NO_MULTITHREAD = 2 } |
enum | ASYNC_FUNC { KSN_CORE_SEND_CMD_TO = 1, TEO_SSCR_SEND = 2, SEND_CMD_ANSWER_TO = 3, TEO_SSCR_SUBSCRIBE = 4 } |
Functions | |
void | teoAsyncTest (void *ke) |
teoAsyncClass * | teoAsyncInit (void *ke) |
Async module initialize. More... | |
void | teoAsyncDestroy (teoAsyncClass *ta) |
Async module destroy and free allocated memory. More... | |
void | ksnCoreSendCmdtoA (void *ke, const char *peer, uint8_t cmd, void *data, size_t data_length) |
void | teoSScrSendA (void *ke, uint16_t event, void *data, size_t data_length, uint8_t cmd) |
void | sendCmdAnswerToBinaryA (void *ke, void *rdp, uint8_t cmd, void *data, size_t data_length) |
void | teoSScrSubscribeA (teoSScrClass *sscr, char *peer, uint16_t ev) |
Send command to subscribe this host to event at remote peer. More... | |
#define CHECK_RETRIVES 10 |
#define kev ((ksnetEvMgrClass*)(ke)) |
Referenced by ksnCoreSendCmdtoA(), sendCmdAnswerToBinaryA(), teoAsyncInit(), teoAsyncTest(), teoSScrSendA(), and teoSScrSubscribeA().
#define LOCK_CV | ( | ) | pthread_mutex_lock(&kev->ta->cv_mutex); |
#define MODULE "async_module" |
Referenced by ksnCoreSendCmdtoA(), sendCmdAnswerToBinaryA(), teoAsyncDestroy(), teoAsyncInit(), teoAsyncTest(), teoSScrSendA(), and teoSScrSubscribeA().
#define MULTITHREADED | ( | ) | (kev->ta->f_multi_thread == MULTITHREAD) |
#define NO_MULTITHREADED | ( | ) | (kev->ta->f_multi_thread == NO_MULTITHREAD) |
#define SEND_ASYNC | ( | buf, | |
buf_length | |||
) |
Referenced by ksnCoreSendCmdtoA(), sendCmdAnswerToBinaryA(), teoSScrSendA(), and teoSScrSubscribeA().
#define SEND_CONDITION | ( | ) | ((ud->rv >= 0 || ud->rv == CHSQ_WRONG_PEER) && ud->rv < SEND_IF) |
#define SET_TIMEOUT | ( | ) |
#define UNLOCK_CV | ( | ) | pthread_mutex_unlock(&kev->ta->cv_mutex); |
typedef struct async_data async_data |
enum ASYNC_FUNC |
enum CHECK_SEND_QUEUE |
enum MULTITHREAD |
void ksnCoreSendCmdtoA | ( | void * | ke, |
const char * | peer, | ||
uint8_t | cmd, | ||
void * | data, | ||
size_t | data_length | ||
) |
References DEBUG, kev, KSN_CORE_SEND_CMD_TO, ksn_printf, ksnCoreSendCmdto(), malloc(), MODULE, and SEND_ASYNC.
Referenced by teo::Teonet::sendToA(), and teoAsyncTest().
void sendCmdAnswerToBinaryA | ( | void * | ke, |
void * | rdp, | ||
uint8_t | cmd, | ||
void * | data, | ||
size_t | data_length | ||
) |
References ksnCorePacketData::addr, DEBUG, ksnCorePacketData::from, ksnCorePacketData::from_len, kev, ksn_printf, ksnCoreSendto(), ksnLNullSendToL0(), ksnCorePacketData::l0_f, malloc(), MODULE, ksnCorePacketData::port, rd, SEND_ASYNC, and SEND_CMD_ANSWER_TO.
Referenced by ksnLNullSendEchoToL0A(), teo::Teonet::sendAnswerToA(), teo::Teonet::sendToL0A(), and teoAsyncTest().
void teoAsyncDestroy | ( | teoAsyncClass * | ta | ) |
Async module destroy and free allocated memory.
ls | Pointer to teoAsyncClass |
References teoAsyncClass::async_func_mutex, teoAsyncClass::cv_mutex, teoAsyncClass::cv_threshold, DEBUG_VV, teoAsyncClass::event_cb, ksnetEvMgrClass::event_cb, free(), teoAsyncClass::ke, ksn_puts, MODULE, and ksnetEvMgrClass::ta.
Referenced by modules_destroy().
teoAsyncClass* teoAsyncInit | ( | void * | ke | ) |
Async module initialize.
ke | Pointer to ksnetEvMgrClass |
References teoAsyncClass::async_func_mutex, teoAsyncClass::cv_mutex, teoAsyncClass::cv_threshold, DEBUG_VV, teoAsyncClass::event_cb, event_cb(), teoAsyncClass::f_multi_thread, teoAsyncClass::ke, ke, kev, ksn_puts, malloc(), MODULE, NOT_DEFINED_MULTITHREAD, teoAsyncClass::t_id, and teoAsyncClass::test.
Referenced by modules_init().
void teoAsyncTest | ( | void * | ke | ) |
void teoSScrSendA | ( | void * | ke, |
uint16_t | event, | ||
void * | data, | ||
size_t | data_length, | ||
uint8_t | cmd | ||
) |
References DEBUG, kev, ksn_printf, malloc(), MODULE, SEND_ASYNC, TEO_SSCR_SEND, and teoSScrSend().
Referenced by teo::Teonet::sendToSscrA(), and teoAsyncTest().
void teoSScrSubscribeA | ( | teoSScrClass * | sscr, |
char * | peer_name, | ||
uint16_t | ev | ||
) |
Send command to subscribe this host to event at remote peer.
sscr | Pointer to teoSScrClass |
peer_name | Remote host name |
ev | Event |
References DEBUG, teoSScrClass::ke, kev, ksn_printf, malloc(), MODULE, SEND_ASYNC, TEO_SSCR_SUBSCRIBE, and teoSScrSubscribe().
Referenced by teo::Teonet::subscribeA(), and teoAsyncTest().