/* $Id$ */ #include "test.h" #include #include #include extern int param_echo_sock_type; extern const char *param_echo_server; extern int param_echo_port; //#if defined(PJ_WIN32) && PJ_WIN32!=0 #if 0 #include static void boost(void) { SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS); } #else #define boost() #endif #if defined(PJ_SUNOS) && PJ_SUNOS!=0 #include static void init_signals() { struct sigaction act; memset(&act, 0, sizeof(act)); act.sa_handler = SIG_IGN; sigaction(SIGALRM, &act, NULL); } #else #define init_signals() #endif int main(int argc, char *argv[]) { int rc; boost(); init_signals(); while (argc > 1) { char *arg = argv[--argc]; if (*arg=='-' && *(arg+1)=='p') { pj_str_t port = pj_str(argv[--argc]); param_echo_port = pj_strtoul(&port); } else if (*arg=='-' && *(arg+1)=='s') { param_echo_server = argv[--argc]; } else if (*arg=='-' && *(arg+1)=='t') { pj_str_t type = pj_str(argv[--argc]); if (pj_stricmp2(&type, "tcp")==0) param_echo_sock_type = PJ_SOCK_STREAM; else if (pj_stricmp2(&type, "udp")==0) param_echo_sock_type = PJ_SOCK_DGRAM; else { PJ_LOG(3,("", "error: unknown socket type %s", type.ptr)); return 1; } } } rc = test_main(); return rc; }