3 #include <sys/socket.h>
4 #include <netinet/in.h>
7 extern objstr_t *mainobjstore;
8 int classsize[]={sizeof(int),sizeof(char),sizeof(short), sizeof(void *)};
13 unsigned int createObjects(transrecord_t *record, unsigned short type) {
14 objheader_t *header, *tmp;
15 struct sockaddr_in antelope;
16 unsigned int size, mid;
17 size = sizeof(objheader_t) + classsize[type] ;
18 header = transCreateObj(record, type);
19 tmp = (objheader_t *) objstrAlloc(mainobjstore, size);
20 memcpy(tmp, header, size);
21 mhashInsert(tmp->oid, tmp);
22 mid = iptoMid("128.200.9.10");
23 lhashInsert(tmp->oid, mid);
26 // tmp->status |= LOCK;
38 transrecord_t *myTrans;
39 pthread_t thread_Listen;
42 pthread_create(&thread_Listen, NULL, dstmListen, NULL);
44 myTrans = transStart();
46 printf("Creating Transaction\n");
48 if((val = createObjects(myTrans, 0)) != 0) {
49 printf("Error transCreateObj1");
52 if((val = createObjects(myTrans, 1)) != 0) {
53 printf("Error transCreateObj2");
56 if((val = createObjects(myTrans, 2)) != 0) {
57 printf("Error transCreateObj3");
60 if((val = createObjects(myTrans, 3)) != 0) {
61 printf("Error transCreateObj4");
64 if((val = createObjects(myTrans, 0)) != 0) {
65 printf("Error transCreateObj5");
68 if((val = createObjects(myTrans, 1)) != 0) {
69 printf("Error transCreateObj6");
71 pthread_join(thread_Listen, NULL);
77 unsigned int val, mid;
78 transrecord_t *myTrans;
79 pthread_t thread_Listen;
82 mid = iptoMid("128.200.9.27");
83 //Inserting into lhashtable
91 pthread_create(&thread_Listen, NULL, dstmListen, NULL);
93 myTrans = transStart();
95 printf("Creating Transaction\n");
97 if((val = createObjects(myTrans, 0)) != 0) {
98 printf("Error transCreateObj1");
101 if((val = createObjects(myTrans, 1)) != 0) {
102 printf("Error transCreateObj2");
105 if((val = createObjects(myTrans, 2)) != 0) {
106 printf("Error transCreateObj3");
109 if((val = createObjects(myTrans, 3)) != 0) {
110 printf("Error transCreateObj4");
113 if((val = createObjects(myTrans, 0)) != 0) {
114 printf("Error transCreateObj5");
117 if((val = createObjects(myTrans, 1)) != 0) {
118 printf("Error transCreateObj6");
120 pthread_join(thread_Listen, NULL);