Changeset 4c53333 in mainline for uspace/app/netecho/netecho.c
- Timestamp:
- 2013-07-11T08:21:10Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 64e63ce1
- Parents:
- 80445cf (diff), c8bb1633 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/netecho/netecho.c
r80445cf r4c53333 243 243 if (verbose) 244 244 printf("accept()\n"); 245 245 socket_id = accept(listening_id, (void *) address_buf, &addrlen); 246 246 if (socket_id <= 0) { 247 247 socket_print_error(stderr, socket_id, "Socket accept: ", "\n"); … … 312 312 rc = sendto(socket_id, reply ? reply : data, reply ? reply_length : length, 0, address, addrlen); 313 313 if (rc != EOK) 314 socket_print_error(stderr, rc, "Socket send : ", "\n");314 socket_print_error(stderr, rc, "Socket sendto: ", "\n"); 315 315 } 316 316 } … … 380 380 address_in6.sin6_family = AF_INET6; 381 381 address_in6.sin6_port = htons(port); 382 address_in6.sin6_addr = in6addr_any; 382 383 address = (struct sockaddr *) &address_in6; 383 384 addrlen = sizeof(address_in6); … … 394 395 return listening_id; 395 396 } 396 397 398 /* Bind the listening socket */ 399 rc = bind(listening_id, address, addrlen); 400 if (rc != EOK) { 401 socket_print_error(stderr, rc, "Socket bind: ", "\n"); 402 return rc; 403 } 404 397 405 /* if the stream socket is used */ 398 406 if (type == SOCK_STREAM) { … … 402 410 backlog = 3; 403 411 } 404 412 405 413 /* Set the backlog */ 406 414 rc = listen(listening_id, backlog); … … 409 417 return rc; 410 418 } 411 }412 413 /* Bind the listening socket */414 rc = bind(listening_id, address, addrlen);415 if (rc != EOK) {416 socket_print_error(stderr, rc, "Socket bind: ", "\n");417 return rc;418 419 } 419 420
Note:
See TracChangeset
for help on using the changeset viewer.