Changeset a62ceaf in mainline for uspace/app/netecho/netecho.c
- Timestamp:
- 2016-02-29T19:19:19Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 129b92c6
- Parents:
- 5147ff1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/netecho/netecho.c
r5147ff1 ra62ceaf 115 115 printf("syntax:\n"); 116 116 printf("\t%s -l <port>\n", NAME); 117 printf("\t%s -d <host> 117 printf("\t%s -d <host>:<port> [<message> [<message...>]]\n", NAME); 118 118 } 119 119 … … 151 151 int main(int argc, char *argv[]) 152 152 { 153 char *host ;153 char *hostport; 154 154 char *port; 155 155 char **msgs; … … 167 167 } 168 168 169 host = NULL;170 169 port = argv[2]; 171 170 msgs = NULL; 171 172 rc = comm_open_listen(port); 173 if (rc != EOK) { 174 printf("Error setting up communication.\n"); 175 return 1; 176 } 172 177 } else if (str_cmp(argv[1], "-d") == 0) { 173 if (argc < 4) {178 if (argc < 3) { 174 179 print_syntax(); 175 180 return 1; 176 181 } 177 182 178 host = argv[2]; 179 port = argv[3]; 180 msgs = argv + 4; 183 hostport = argv[2]; 184 port = NULL; 185 msgs = argv + 3; 186 187 rc = comm_open_talkto(hostport); 188 if (rc != EOK) { 189 printf("Error setting up communication.\n"); 190 return 1; 191 } 181 192 } else { 182 193 print_syntax(); 183 return 1;184 }185 186 rc = comm_open(host, port);187 if (rc != EOK) {188 printf("Error setting up communication.\n");189 194 return 1; 190 195 }
Note:
See TracChangeset
for help on using the changeset viewer.