comparison smpp-trx-sa/main.c @ 263:1bf989f60aa3

smpp-trx-sa: log times of enquire_link packets
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 11 Oct 2023 21:22:32 -0800
parents a375639e4190
children
comparison
equal deleted inserted replaced
262:f1c024b2b835 263:1bf989f60aa3
40 { 40 {
41 struct sockaddr_in server_sin; 41 struct sockaddr_in server_sin;
42 fd_set fds; 42 fd_set fds;
43 int max_fd, rc; 43 int max_fd, rc;
44 44
45 if (argc != 6) { 45 if (argc < 6 || argc > 7) {
46 fprintf(stderr, 46 fprintf(stderr,
47 "usage: %s server-ip system-id password log-file socket-pathname\n", 47 "usage: %s server-ip system-id password log-file socket-pathname [enq-link]\n",
48 argv[0]); 48 argv[0]);
49 exit(1); 49 exit(1);
50 } 50 }
51 server_sin.sin_family = AF_INET; 51 server_sin.sin_family = AF_INET;
52 server_sin.sin_addr.s_addr = inet_addr(argv[1]); 52 server_sin.sin_addr.s_addr = inet_addr(argv[1]);
67 logF = fopen(argv[4], "a"); 67 logF = fopen(argv[4], "a");
68 if (!logF) { 68 if (!logF) {
69 perror(argv[4]); 69 perror(argv[4]);
70 exit(1); 70 exit(1);
71 } 71 }
72 if (argv[6])
73 log_enquire_link_open(argv[6]);
72 create_local_socket(argv[5]); 74 create_local_socket(argv[5]);
73 max_fd = localsock; 75 max_fd = localsock;
74 open_tcp_conn(&server_sin); 76 open_tcp_conn(&server_sin);
75 if (tcpsock > max_fd) 77 if (tcpsock > max_fd)
76 max_fd = tcpsock; 78 max_fd = tcpsock;