Changeset 92e717c in mainline for uspace/app/netecho/netecho.c


Ignore:
Timestamp:
2011-11-30T20:23:09Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
23fe06c
Parents:
8fcf74f
Message:

Add nettest3 for more trivial testing. Netecho should use send() for stream sockets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/netecho/netecho.c

    r8fcf74f r92e717c  
    297297
    298298                        /* Answer the request either with the static reply or the original data */
    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");
     299                        if (type == SOCK_STREAM) {
     300                                rc = send(socket_id, reply ? reply : data, reply ? reply_length : length, 0);
     301                                if (rc != EOK)
     302                                        socket_print_error(stderr, rc, "Socket send: ", "\n");
     303                        } else {
     304                                rc = sendto(socket_id, reply ? reply : data, reply ? reply_length : length, 0, address, addrlen);
     305                                if (rc != EOK)
     306                                        socket_print_error(stderr, rc, "Socket send: ", "\n");
     307                        }
    302308                }
    303309
Note: See TracChangeset for help on using the changeset viewer.