Changeset 453f9e33 in mainline
- Timestamp:
- 2011-12-05T18:38:15Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5f9ecd3
- Parents:
- bf600510
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/nettest3/nettest3.c
rbf600510 r453f9e33 59 59 int rc; 60 60 int fd; 61 char *endptr; 61 62 62 port = 80;63 port = 7; 63 64 64 65 data = (char *)"Hello World!"; 65 66 size = str_size(data); 66 67 68 /* Connect to local IP address by default */ 67 69 addr.sin_family = AF_INET; 68 70 addr.sin_port = htons(port); 69 71 addr.sin_addr.s_addr = htonl(0x7f000001); 72 73 if (argc >= 2) { 74 printf("parsing address '%s'\n", argv[1]); 75 rc = inet_pton(AF_INET, argv[1], (uint8_t *)&addr.sin_addr.s_addr); 76 if (rc != EOK) { 77 fprintf(stderr, "Error parsing address\n"); 78 return 1; 79 } 80 printf("result: rc=%d, family=%d, addr=%x\n", rc, 81 addr.sin_family, addr.sin_addr.s_addr); 82 } 83 84 if (argc >= 3) { 85 printf("parsing port '%s'\n", argv[2]); 86 addr.sin_port = htons(strtoul(argv[2], &endptr, 10)); 87 if (*endptr != '\0') { 88 fprintf(stderr, "Error parsing port\n"); 89 return 1; 90 } 91 } 70 92 71 93 printf("socket()\n");
Note:
See TracChangeset
for help on using the changeset viewer.