Currently sockets are managed in multiple classes. We have a class to handle inbound connections and another to handle outbound connections. We also have another class to handle rate limiting. These classes are initialized all over creating a crack in sockets and peer connection management.
Configuration is also very chaotic and we have differing defaults being passed everywhere these classes are initialized. The config values for rate limits are disconnected between inbound and inbound connections too. This makes it hard to figure out which instance is being used where, especially when it comes to rate limiting.
Outbound connections are solely used to send outbound messages and inbound connections are used to receive inbound messages. This is not very efficient as we can reuse a single socket to do bidirectional communication.
The plan is to:
Currently sockets are managed in multiple classes. We have a class to handle inbound connections and another to handle outbound connections. We also have another class to handle rate limiting. These classes are initialized all over creating a crack in sockets and peer connection management.
Configuration is also very chaotic and we have differing defaults being passed everywhere these classes are initialized. The config values for rate limits are disconnected between inbound and inbound connections too. This makes it hard to figure out which instance is being used where, especially when it comes to rate limiting.
Outbound connections are solely used to send outbound messages and inbound connections are used to receive inbound messages. This is not very efficient as we can reuse a single socket to do bidirectional communication.
The plan is to:
ConnectionPoolsingleton classPeerConnectionclassConnectionPoolonly happens once and subsequent references use that instanceSharedState