Changes in uspace/app/netecho/netecho.c [92b42442:cd22764] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/netecho/netecho.c
r92b42442 rcd22764 241 241 /* Accept a socket if a stream socket is used */ 242 242 addrlen = sizeof(address_buf); 243 if (verbose)244 printf("accept()\n");245 243 socket_id = accept(listening_id, (void *) address_buf, &addrlen); 246 244 if (socket_id <= 0) { … … 260 258 261 259 /* Receive a message to echo */ 262 if (verbose)263 printf("recvfrom()\n");264 260 rcv_size = recvfrom(socket_id, data, size, 0, address, 265 261 &addrlen); … … 301 297 302 298 /* Answer the request either with the static reply or the original data */ 303 if (type == SOCK_STREAM) { 304 if (verbose) 305 printf("send()\n"); 306 rc = send(socket_id, reply ? reply : data, reply ? reply_length : length, 0); 307 if (rc != EOK) 308 socket_print_error(stderr, rc, "Socket send: ", "\n"); 309 } else { 310 if (verbose) 311 printf("sendto()\n"); 312 rc = sendto(socket_id, reply ? reply : data, reply ? reply_length : length, 0, address, addrlen); 313 if (rc != EOK) 314 socket_print_error(stderr, rc, "Socket send: ", "\n"); 315 } 299 rc = sendto(socket_id, reply ? reply : data, reply ? reply_length : length, 0, address, addrlen); 300 if (rc != EOK) 301 socket_print_error(stderr, rc, "Socket send: ", "\n"); 316 302 } 317 303 … … 373 359 address_in.sin_family = AF_INET; 374 360 address_in.sin_port = htons(port); 375 address_in.sin_addr.s_addr = INADDR_ANY;376 361 address = (struct sockaddr *) &address_in; 377 362 addrlen = sizeof(address_in);
Note:
See TracChangeset
for help on using the changeset viewer.