Commit 010e977b12193d3c5b49aa0eada7d07248414580

Authored by Georg Hopp
1 parent bc8faa92

remove no longer used test program

1 #!/bin/bash 1 #!/bin/bash
2 -#TRLIBS="-ltrbase -ltrhashing -ltrio -ltrdata -ltrevent -ltrcomm"  
3 -TRLIBS="/usr/local/lib/libtrcomm.a /usr/local/lib/libtrevent.a /usr/local/lib/libtrdata.a /usr/local/lib/libtrio.a /usr/local/lib/libtrhashing.a /usr/local/lib/libtrbase.a" 2 +TRLIBS="-ltrbase -ltrhashing -ltrio -ltrdata -ltrevent -ltrcomm"
  3 +#TRLIBS="/usr/local/lib/libtrcomm.a /usr/local/lib/libtrevent.a /usr/local/lib/libtrdata.a /usr/local/lib/libtrio.a /usr/local/lib/libtrhashing.a /usr/local/lib/libtrbase.a"
4 LIBS="-lcrypto -lssl -lrt -luuid" 4 LIBS="-lcrypto -lssl -lrt -luuid"
5 gcc ${CFLAGS} -std=c99 -c -o test_handler.o test_handler.c 5 gcc ${CFLAGS} -std=c99 -c -o test_handler.o test_handler.c
6 -gcc ${CFLAGS} -std=c99 -I/usr/local/include -L/usr/local/lib ${LIBS} -o testserver testserver.c test_handler.o ${TRLIBS}  
7 gcc ${CFLAGS} -std=c99 -I/usr/local/include -L/usr/local/lib ${LIBS} -o testserver2 testserver2.c test_handler.o ${TRLIBS} 6 gcc ${CFLAGS} -std=c99 -I/usr/local/include -L/usr/local/lib ${LIBS} -o testserver2 testserver2.c test_handler.o ${TRLIBS}
8 gcc ${CFLAGS} -std=c99 -I/usr/local/include -L/usr/local/lib ${LIBS} -o testtcp testclient.c ${TRLIBS} 7 gcc ${CFLAGS} -std=c99 -I/usr/local/include -L/usr/local/lib ${LIBS} -o testtcp testclient.c ${TRLIBS}
9 gcc ${CFLAGS} -std=c99 -I/usr/local/include -L/usr/local/lib ${LIBS} -DUDP=1 -o testudp testclient.c ${TRLIBS} 8 gcc ${CFLAGS} -std=c99 -I/usr/local/include -L/usr/local/lib ${LIBS} -DUDP=1 -o testudp testclient.c ${TRLIBS}
1 -#include <stdio.h>  
2 -#include <string.h>  
3 -#include <inttypes.h>  
4 -  
5 -#include "trbase.h"  
6 -#include "trcomm.h"  
7 -#include "trevent.h"  
8 -  
9 -#include "test_handler.h"  
10 -  
11 -TR_INSTANCE(TR_LoggerSyslog, mylogger, {TR_LOGGER_DEBUG});  
12 -  
13 -int  
14 -main (int argc, char * argv[])  
15 -{  
16 - TR_CommManager cmgr = (TR_CommManager)TR_new(TR_CommManagerPoll);  
17 - TR_EventDispatcher dispatcher = TR_new(TR_EventDispatcher);  
18 - TR_Connector connector = TR_new(TR_Connector);  
19 - TR_IoHandler io_handler = TR_new(TR_IoHandler);  
20 - TR_ProtocolHandler protocol_handler = TR_new(TR_ProtocolHandler);  
21 - TestHandler test_handler = TR_new(TestHandler);  
22 - TR_ConnEntryPoint tcp_ep;  
23 - TR_TcpSocket tcp_ep_sock;  
24 - TR_DatagramService udp_ep;  
25 - TR_UdpSocket udp_ep_sock;  
26 - TR_Protocol protocol;  
27 -  
28 - TR_logger = TR_INSTANCE_CAST(TR_Logger, mylogger);  
29 -  
30 - TR_eventDispatcherRegisterHandler(dispatcher, (TR_EventHandler)cmgr);  
31 - TR_eventDispatcherRegisterHandler(dispatcher, (TR_EventHandler)connector);  
32 - TR_eventDispatcherRegisterHandler(dispatcher, (TR_EventHandler)io_handler);  
33 - TR_eventDispatcherRegisterHandler(  
34 - dispatcher,  
35 - (TR_EventHandler)protocol_handler);  
36 - TR_eventDispatcherRegisterHandler(  
37 - dispatcher,  
38 - (TR_EventHandler)test_handler);  
39 -  
40 - protocol = TR_new(TR_ProtocolRaw);  
41 - tcp_ep_sock = TR_new(TR_TcpSocket, TR_logger, "0.0.0.0", 5678, 0);  
42 - tcp_ep = TR_new(TR_ConnEntryPoint, tcp_ep_sock, protocol);  
43 - udp_ep_sock = TR_new(TR_UdpSocket, TR_logger, "0.0.0.0", 5678, 0);  
44 - TR_socketBind((TR_Socket)udp_ep_sock);  
45 - TR_socketNonblock((TR_Socket)udp_ep_sock);  
46 - udp_ep = TR_new(TR_DatagramService, udp_ep_sock, protocol);  
47 -  
48 - TR_commManagerAddEndpoint(cmgr, (TR_CommEndPoint)tcp_ep);  
49 - TR_commManagerAddEndpoint(cmgr, (TR_CommEndPoint)udp_ep);  
50 -  
51 - TR_eventDispatcherSetHeartbeat(dispatcher, 1000);  
52 - TR_eventDispatcherStart(dispatcher);  
53 -  
54 - puts("cleanup...");  
55 -  
56 - TR_delete(cmgr);  
57 - TR_delete(dispatcher);  
58 - TR_delete(connector);  
59 - TR_delete(io_handler);  
60 - TR_delete(protocol_handler);  
61 - TR_delete(test_handler);  
62 - TR_delete(protocol);  
63 - //TR_delete(ep);  
64 -  
65 - TR_eventHandlerClassCleanup(TestHandler);  
66 - TR_eventHandlerClassCleanup(TR_ProtocolHandler);  
67 - TR_eventHandlerClassCleanup(TR_IoHandler);  
68 - TR_eventHandlerClassCleanup(TR_Connector);  
69 - TR_eventHandlerClassCleanup(TR_CommManagerPoll);  
70 -  
71 - TR_cleanup();  
72 -  
73 - return 0;  
74 -}  
75 -  
76 -// vim: set ts=4 sw=4:  
Please register or login to post a comment