Teonet library  0.4.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
teoloadsi/src/main.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "ev_mgr.h"
#include "config.h"

Macros

#define APP_VERSION   "0.0.1"
 
#define CMD_T   129
 
#define INTERVAL   0.25
 
#define BUFFER_SIZE   128
 
#define NUM_TO_SHOW   10000
 
#define SERVER_PEER   ke->teo_cfg.app_argv[1]
 

Typedefs

typedef struct cmd_data cmd_data
 Simple load test data structure. More...
 

Functions

void sendCmdT (ksnetEvMgrClass *ke, const char *to, int id, int type)
 ! Server flag: 1 - this host is a server, 0 - this host is a client More...
 
void event_cb (ksnetEvMgrClass *ke, ksnetEvMgrEvents event, void *data, size_t data_length, void *user_data)
 Teonet event handler. More...
 
int main (int argc, char **argv)
 Main application function. More...
 

Macro Definition Documentation

#define APP_VERSION   "0.0.1"

Referenced by main().

#define BUFFER_SIZE   128

Referenced by sendCmdT().

#define CMD_T   129

Referenced by event_cb(), and sendCmdT().

#define INTERVAL   0.25

Referenced by main().

#define NUM_TO_SHOW   10000

Referenced by event_cb(), and sendCmdT().

#define SERVER_PEER   ke->teo_cfg.app_argv[1]

Referenced by event_cb().

Typedef Documentation

typedef struct cmd_data cmd_data

Simple load test data structure.

Function Documentation

void event_cb ( ksnetEvMgrClass ke,
ksnetEvMgrEvents  event,
void *  data,
size_t  data_length,
void *  user_data 
)

Teonet event handler.

Parameters
ke
event
data
data_length
user_data

References ksnCorePacketData::cmd, CMD_T, ksnCorePacketData::data, DEBUG, ERROR_M, EV_K_CONNECTED, EV_K_RECEIVED, EV_K_STOPPED, EV_K_TIMER, ksnCorePacketData::from, ksn_printf, ksn_puts, NUM_TO_SHOW, rd, sendCmdT(), and SERVER_PEER.

Referenced by main().

void sendCmdT ( ksnetEvMgrClass ke,
const char *  to,
int  id,
int  type 
)

! Server flag: 1 - this host is a server, 0 - this host is a client

Send command with simple load test data

Parameters
kePointer to ksnetEvMgrClass
toPeer name
idPacket id
typePacket type: 0 - request, 1 - response

References BUFFER_SIZE, CMD_T, DEBUG, ksnetEvMgrClass::kc, ksn_printf, ksnCoreSendCmdto(), and NUM_TO_SHOW.

Referenced by event_cb().