I'm currently working on an application-level proxy library that sits
between the client and the server and allows applications to register
callbacks that inspect and modify packets as they pass through. Most
of the code is working, but I'm trying to deal with appended ACKs and
the code in NetworkManager is confusing and potentially broken:
private void OnReceivedData(IAsyncResult result)
...
// Retrieve the incoming packet
int numBytes =
Connection.EndReceiveFrom(result, ref endPoint);
if ((Buffer[Buffer.Length - 1] &
Helpers.MSG_APPENDED_ACKS) != 0)
{
// Grab the ACKs that are
appended to this packet
byte numAcks = Buffer
[Buffer.Length - 1];
Why is it looking at the last byte of the buffer instead of the first
byte for MSG_APPENDED_ACKS, and why is it reusing the same byte to
determine how many ACKs there are? If this is in fact wrong, is
there a way to determine how many ACKs there should be, short of
calculating the expected length of the packet and counting the number
of extra bytes on the end? Thanks.
-- Era Pixel
_______________________________________________
libsecondlife-dev mailing list
libsecondlife-dev@gna.org
https://mail.gna.org/listinfo/libsecondlife-dev