Changeset 477 in ntrip
- Timestamp:
- Aug 6, 2007, 9:42:25 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/rtcm3torinex/rtcm3torinex.c
r439 r477 1 1 /* 2 2 Converter for RTCM3 data to RINEX. 3 $Id: rtcm3torinex.c,v 1.1 7 2007/01/23 17:16:39 stoecker Exp $3 $Id: rtcm3torinex.c,v 1.18 2007/04/11 09:08:39 stoecker Exp $ 4 4 Copyright (C) 2005-2006 by Dirk Stoecker <stoecker@euronik.eu> 5 5 … … 51 51 52 52 /* CVS revision and version */ 53 static char revisionstr[] = "$Revision: 1.1 7$";53 static char revisionstr[] = "$Revision: 1.18 $"; 54 54 55 55 #ifndef COMPILEDATE … … 1021 1021 1022 1022 #ifndef NO_RTCM3_MAIN 1023 static char datestr[] = "$Date: 2007/0 1/23 17:16:39 $";1023 static char datestr[] = "$Date: 2007/04/11 09:08:39 $"; 1024 1024 1025 1025 /* The string, which is send as agent in HTTP request */ … … 1083 1083 const char *server; 1084 1084 int port; 1085 int timeout; 1085 1086 const char *user; 1086 1087 const char *password; … … 1099 1100 { "password", required_argument, 0, 'p'}, 1100 1101 { "port", required_argument, 0, 'r'}, 1102 { "timeout", required_argument, 0, 't'}, 1101 1103 { "header", required_argument, 0, 'f'}, 1102 1104 { "user", required_argument, 0, 'u'}, … … 1104 1106 {0,0,0,0}}; 1105 1107 #endif 1106 #define ARGOPT "-d: hp:r:s:u:f:"1108 #define ARGOPT "-d:s:p:r:t:f:u:h" 1107 1109 1108 1110 static const char *geturl(const char *url, struct Args *args) … … 1187 1189 args->server = "www.euref-ip.net"; 1188 1190 args->port = 2101; 1191 args->timeout = 60; 1189 1192 args->user = ""; 1190 1193 args->password = ""; … … 1195 1198 do 1196 1199 { 1200 1197 1201 #ifdef NO_LONG_OPTS 1198 1202 switch((getoptr = getopt(argc, argv, ARGOPT))) … … 1212 1216 res = 0; 1213 1217 break; 1218 case 't': 1219 args->timeout = strtoul(optarg, &t, 10); 1220 if((t && *t) || args->timeout < 0) 1221 res = 0; 1222 break; 1223 1214 1224 case 1: 1215 1225 { … … 1246 1256 " -p " LONG_OPT("--password ") "the login password\n" 1247 1257 " -r " LONG_OPT("--port ") "the server port number (default 2101)\n" 1258 " -t " LONG_OPT("--timeout ") "timeout in seconds\n" 1248 1259 " -u " LONG_OPT("--user ") "the user name\n" 1249 1260 "or using an URL:\n%s ntrip:mountpoint[/username[:password]][@server[:port]]\n" … … 1283 1294 struct RTCM3ParserData Parser; 1284 1295 1296 struct timeval tv; 1297 1285 1298 setbuf(stdout, 0); 1286 1299 setbuf(stdin, 0); … … 1327 1340 exit(1); 1328 1341 } 1342 1343 tv.tv_sec = args.timeout; 1344 tv.tv_usec = 0; 1345 if(setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, (struct timeval *)&tv, sizeof(struct timeval) ) == -1) 1346 { 1347 RTCM3Error("Function setsockopt: %s\n", strerror(errno)); 1348 exit(1); 1349 } 1350 1329 1351 their_addr.sin_family = AF_INET; /* host byte order */ 1330 1352 their_addr.sin_port = htons(args.port); /* short, network byte order */
Note:
See TracChangeset
for help on using the changeset viewer.