Files
skevity/source/server_source/transactions.c

51 lines
824 B
C

#include "transactions.h"
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#define PORT 2223
#define IP_ADDRESS "127.0.0.1"
int CreateTransaction(action *act) {
int bufferSize = sizeof(int)*3 + act->argsize;
//unsigned char* buffer = malloc(bufferSize);
//buffer[0] = act->id;
//buffer[sizeof(int)*1] = act->action;
//buffer[sizeof(int)*2] = act->argsize;
//memcpy(&buffer[sizeof(int)*3], act->userArg, act->argsize);
//free(buffer);
return 0;
}
int GetTransaction(action *act) {
int id;
int action;
int argsize;
void* data;
act->id = id;
act->action = action;
act->argsize = argsize;
act->userArg = data;
return 0;
}
int ProssesTransaction(action *act) {
return 0;
}