njones / socketio

A Modern SocketIO library for go
MIT License
60 stars 9 forks source link

EIO functional options version compatibility #15

Closed njones closed 2 years ago

njones commented 2 years ago

Update the EIO server so that it can look through previous server versions when applying functional options to a server version. Now later versions of the server can use a functional option for a previous version.

There was a bug in how the functional option was applied previously. While previous versions would get the option applied it would be overwritten by later versions as they were initialized. Because the later server versions did not match the version of the server the functional option could apply to, it would not reflect the change that the functional option intended. This is now mitigated by looking though previous versions of the server that the functional option is applied to.

:label: NOTE: Because we are looking through every functional option on every previous version initialization, there is an O(n^n) effect that could slow down code that has many options.