Why are peer IDs limited to 0-255? Why couldn't it just be an integer, positive, and happy? Granted, there will likely never be a time when there are more than 256 connections, but if we are limited to 256 unique ID numbers, then we'll have to check if a peer already has that ID number for every ID number we issue. While not hard, it seems unnecessary to me.
If there are going to any more changes, if you could find a way to notify everybody as soon as you can, that'd be great. Spec changes are already being rough on us.
Peer ID numbers and Regex
Moderator: jaf656s
- Paco103
- Single White Admin
- Posts: 629
- Joined: January 15, 2004, 9:22 pm
- Location: Right Here
- Contact:
We're trying to minimize spec changes as much as possible, and I've updated the thread title to include update times. If you wish to be notified of all updates, you can register an account and subscribe to the protocol thread using the "Watch this topic for replies" link at the bottom.
Peer ID's are limited to 255 in the spec because the original plan was to just send the byte value, however we realized this could become a problem for parsing so we changed it to the numerical value. We chose this size because it is large enough for our needs, yet small enough to be simple and effecient. This is one of those areas where you can look at the protocol and design your client to be clever. If you wish to go outside of this range, it will not interfere with the protocol or other clients that are implemented properly. However, using a single byte allows you to reference everything in a single array of a known (and yet small/manageable) size. Going up to 999 for example before wrapping will not change the size of the message, and since the number is only for your reference, it will not effect anyone else.
Peer ID's are limited to 255 in the spec because the original plan was to just send the byte value, however we realized this could become a problem for parsing so we changed it to the numerical value. We chose this size because it is large enough for our needs, yet small enough to be simple and effecient. This is one of those areas where you can look at the protocol and design your client to be clever. If you wish to go outside of this range, it will not interfere with the protocol or other clients that are implemented properly. However, using a single byte allows you to reference everything in a single array of a known (and yet small/manageable) size. Going up to 999 for example before wrapping will not change the size of the message, and since the number is only for your reference, it will not effect anyone else.