Create and use same UDP socket for each request (#12)
Create and use same UDP socket for each request (#12)

Previously, the code created a new UDP socket for each metric sent. This
incurs a signficant overhead per metric sent, as can be seen in the
following comparisons.

This commit moves the UDP socket open into the constructor and reuses
the same socket for each metric sent, significantly improving per-metric
send times.

Comparison using cargo-benchcmp:

    name                    new_socket ns/iter  reuse_socket ns/iter  diff ns/iter   diff %
    bench::bench_decr       190,423             3,345                     -187,078  -98.24%
    bench::bench_event      146,713             3,614                     -143,099  -97.54%
    bench::bench_gauge      153,778             3,507                     -150,271  -97.72%
    bench::bench_histogram  178,040             3,507                     -174,533  -98.03%
    bench::bench_incr       181,901             3,374                     -178,527  -98.15%
    bench::bench_set        163,280             3,552                     -159,728  -97.82%
    bench::bench_timing     142,588             3,420                     -139,168  -97.60%

Signed-off-by: Nick Stevens <75ef9faee755c70589550b513ad881e5a603182c@bitcurry.com>
mcasper/dogstatsd-rs