Skip to content

Commit eb68892

Browse files
Update README.md
Signed-off-by: Glenn Fiedler <glenn@networknext.com>
1 parent 04cde1a commit eb68892

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

README.md

+5-8
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Before you send a packet, you can ask reliable what sequence number the sent pac
100100
uint16_t sequence = reliable_endpoint_next_packet_sequence( endpoint );
101101
```
102102

103-
This way you can map acked sequence numbers to the contents of packets you sent, for example to resend unacked messages until a packet that included that message was acked.
103+
This way you can map acked sequence numbers to the contents of packets you sent, for example, resending unacked messages until a packet that included that message was acked.
104104

105105
Make sure to update each endpoint once per-frame. This keeps track of network stats like latency, jitter, packet loss and bandwidth:
106106

@@ -111,13 +111,10 @@ reliable_endpoint_update( endpoint, time );
111111
You can then grab stats from the endpoint:
112112
113113
```c
114-
printf( "%" PRIi64 " sent | %" PRIi64 " received | %" PRIi64 " acked | rtt = %dms | jitter = %dms | packet loss = %d%% | sent = %dkbps | recv = %dkbps | acked = %dkbps\n",
115-
counters[RELIABLE_ENDPOINT_COUNTER_NUM_PACKETS_SENT],
116-
counters[RELIABLE_ENDPOINT_COUNTER_NUM_PACKETS_RECEIVED],
117-
counters[RELIABLE_ENDPOINT_COUNTER_NUM_PACKETS_ACKED],
118-
(int) reliable_endpoint_rtt_min( global_context.client ),
119-
(int) reliable_endpoint_jitter( global_context.client ),
120-
(int) ( reliable_endpoint_packet_loss( global_context.client ) + 0.5f ),
114+
printf( rtt = %.1fms | jitter = %.1fms | packet loss = %.1f%%\n",
115+
reliable_endpoint_rtt_min( endpoint ),
116+
reliable_endpoint_jitter( endpoint ),
117+
reliable_endpoint_packet_loss( endpoint ) ),
121118
```
122119

123120
When you are finished with an endpoint, destroy it:

0 commit comments

Comments
 (0)