nuttx-apps/examples/tcpblaster
Xiang Xiao 3398aad7eb examples/tcpblaster: Fix the nightly build warning
tcpblaster_server.c: In function 'tcpblaster_server':
tcpblaster_server.c:256:71: warning: passing argument 1 of 'localtime' from incompatible pointer type [-Wincompatible-pointer-types]
           strftime(timebuff, 100, "%Y-%m-%d %H:%M:%S.000", localtime (&curr));
                                                                       ^
In file included from tcpblaster_server.c:50:0:
/usr/include/time.h:123:19: note: expected 'const time_t * {aka const long int *}' but argument is of type 'struct timespec *'
 extern struct tm *localtime (const time_t *__timer) __THROW;
                   ^~~~~~~~~
tcpblaster_client.c: In function 'tcpblaster_client':
tcpblaster_client.c:230:71: warning: passing argument 1 of 'localtime' from incompatible pointer type [-Wincompatible-pointer-types]
           strftime(timebuff, 100, "%Y-%m-%d %H:%M:%S.000", localtime (&curr));
                                                                       ^
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-03-09 09:17:07 +01:00
..
.gitignore
Kconfig tcpblaster reporting and docs improvements 2020-02-24 20:09:35 -06:00
Make.defs
Makefile tcpblaster reporting and docs improvements 2020-02-24 20:09:35 -06:00
README.txt tcpblaster reporting and docs improvements 2020-02-24 20:09:35 -06:00
tcpblaster_client.c examples/tcpblaster: Fix the nightly build warning 2020-03-09 09:17:07 +01:00
tcpblaster_cmdline.c apps/examples/tcpblaster: Fix compile errors in loopback mode. 2020-02-10 21:05:49 +01:00
tcpblaster_host.c
tcpblaster_netinit.c
tcpblaster_server.c examples/tcpblaster: Fix the nightly build warning 2020-03-09 09:17:07 +01:00
tcpblaster_target1.c Unify the void cast usage 2020-01-02 23:21:01 +08:00
tcpblaster_target2.c
tcpblaster.h tcpblaster reporting and docs improvements 2020-02-24 20:09:35 -06:00

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

tcpblaster Performance Test Example
===================================

To set up, do `make menuconfig` and select the Apps > Examples > tcpblaster. By default, nuttx will the be the client
which sends data; and the host computer (Linux, macOS, or Windows) will be the server.

Set up networking so the nuttx computer can ping the host, and the host can ping nuttx. Now you are ready to run the
test.

On host:

    $ ./tcpserver
    Binding to IPv4 Address: 00000000
    server: Accepting connections on port 5471

On nuttx:

    nsh> tcpclient
    Connecting to IPv4 Address: 0100000a
    client: Connected
    [2014-07-31 00:16:15.000] 0: Sent 200 4096-byte buffers:    800.0 KB (avg   4.0 KB) in   0.18 seconds ( 4444.4 KB/second)

Now on the host you should see something like:

    $ ./tcpserver
    Binding to IPv4 Address: 00000000
    server: Accepting connections on port 5471
    server: Connection accepted -- receiving
    [2020-02-22 16:17:07.000] 0: Received 200 buffers:   502.9 KB (buffer average size:   2.5 KB) in   0.12 seconds ( 4194.8 KB/second)
    [2020-02-22 16:17:07.000] 1: Received 200 buffers:   393.1 KB (buffer average size:   2.0 KB) in   0.09 seconds ( 4299.4 KB/second)


This will tell you the link speed in KB/sec  kilobytes per second. If you want kilobits, multiply by 8.

You can use the `make menuconfig` to reverse the setup, and have nuttx be the server, and the host be the client. If you
do that, start the server first (nuttx), then start the client (host).