{
duration = GNUNET_TIME_absolute_get_duration (start_time);
fprintf (stderr,
- "Received %llu bytes/s\n",
- traffic_received / (1+duration.rel_value));
+ "Received %llu bytes/s (%llu bytes in %llu ms)\n",
+ 1000 * traffic_received / (1+duration.rel_value),
+ traffic_received,
+ (unsigned long long) duration.rel_value);
}
if (benchmark_send)
{
duration = GNUNET_TIME_absolute_get_duration (start_time);
fprintf (stderr,
- "Transmitted %llu bytes/s\n",
- traffic_sent / (1+duration.rel_value));
+ "Transmitted %llu bytes/s (%llu bytes in %llu ms)\n",
+ 1000 * traffic_sent / (1+duration.rel_value),
+ traffic_sent,
+ (unsigned long long) duration.rel_value);
}
}
0,
GNUNET_TIME_UNIT_FOREVER_REL,
&transmit_data, NULL);
+ fprintf (stderr,
+ "Transmitting %u bytes to %s\n",
+ (unsigned int) size,
+ GNUNET_i2s (&pid));
return size;
}
GNUNET_ATS_Information
* ats, uint32_t ats_count)
{
+ fprintf (stderr,
+ "Connected to %s\n",
+ GNUNET_i2s (peer));
if (0 != memcmp (&pid,
peer,
sizeof (struct GNUNET_PeerIdentity)))
const struct
GNUNET_PeerIdentity * peer)
{
+ fprintf (stderr,
+ "Disconnected from %s\n",
+ GNUNET_i2s (peer));
if ( (0 == memcmp (&pid,
peer,
sizeof (struct GNUNET_PeerIdentity))) &&
{
if (! benchmark_receive)
return;
+ fprintf (stderr,
+ "Received %u bytes from %s\n",
+ (unsigned int) ntohs (message->size),
+ GNUNET_i2s (peer));
if (traffic_received == 0)
start_time = GNUNET_TIME_absolute_get ();
traffic_received += ntohs (message->size);
if (NULL != cpid)
{
ret = 1;
- handle = GNUNET_TRANSPORT_connect (cfg, NULL, NULL,
- ¬ify_receive,
- ¬ify_connect,
- ¬ify_disconnect);
if (GNUNET_OK !=
GNUNET_CRYPTO_hash_from_string (cpid, &pid.hashPubKey))
{
fprintf (stderr,
_("Failed to parse peer identity `%s'\n"),
cpid);
- GNUNET_TRANSPORT_disconnect (handle);
return;
}
+ handle = GNUNET_TRANSPORT_connect (cfg, NULL, NULL,
+ ¬ify_receive,
+ ¬ify_connect,
+ ¬ify_disconnect);
GNUNET_TRANSPORT_try_connect (handle, &pid);
end = GNUNET_SCHEDULER_add_delayed (benchmark_send
? GNUNET_TIME_UNIT_FOREVER_REL